bumptech / bumptech/glide

`NullPointerException` on Nexus 5X bots/emulators from Google Play

Open
#4,503 0 comments 20 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

**Glide Version**:

4.11.0

**Device/Android Version**:

Nexus 5X

**Issue details / Repro steps / Use case background**:

This actually occurs in `react-native-fast-image` which uses this behind the hood and has been a big issue there: https://github.com/DylanVann/react-native-fast-image/issues/536

The issue linked above was marked as fixed by bumping glide to 4.11.0 because of this: https://github.com/bumptech/glide/issues/3857#issuecomment-530885597. However, that didn't seem to fix it.

The error only seems to happen when Google's bots/emulators check the app after submitting a new release to the Google Play store. I have noticed it in my [Sentry](https://sentry.io/) logs.

I believe this results in delays in approving apps. Mine have been staying "In Review" for way longer than normally expected.

It appears that this line produces the crash:
https://github.com/DylanVann/react-native-fast-image/blob/0439f7190f141e51a391c84890cdd8a7067c6ad3/android/src/main/java/com/dylanvann/fastimage/FastImageOkHttpProgressGlideModule.java#L49

Any ideas what would be wrong here? Is `react-native-fast-image` doing things wrong or what could be the reason for this?

**Stack trace / LogCat**:
```
java.lang.NullPointerException: Attempt to invoke virtual method 'com.bumptech.glide.Registry com.bumptech.glide.Registry.replace(java.lang.Class, java.lang.Class, com.bumptech.glide.load.model.ModelLoaderFactory)' on a null object reference
at com.dylanvann.fastimage.FastImageOkHttpProgressGlideModule.registerComponents(FastImageOkHttpProgressGlideModule.java:49)
at com.bumptech.glide.GeneratedAppGlideModuleImpl.registerComponents(GeneratedAppGlideModuleImpl.java:34)
at com.bumptech.glide.Glide.initializeGlide(Glide.java:305)
at com.bumptech.glide.Glide.initializeGlide(Glide.java:242)
at com.bumptech.glide.Glide.checkAndInitializeGlide(Glide.java:201)
at com.bumptech.glide.Glide.get(Glide.java:182)
at com.bumptech.glide.Glide.getRetriever(Glide.java:749)
at com.bumptech.glide.Glide.with(Glide.java:776)
at com.dylanvann.fastimage.FastImageViewManager.createViewInstance(FastImageViewManager.java:51)
at com.dylanvann.fastimage.FastImageViewManager.createViewInstance(FastImageViewManager.java:33)
at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java:139)
at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:83)
at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:261)
at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:186)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:1112)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1083)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:603)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5421)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
```

I'm sorry that I can't provide a better error description, but `react-native-fast-image` has 432k downloads per month, and it seems the issue isn't getting any attention on that side. Hopefully someone can point out whether this is an usage problem on that side, or a bug in `glide`.

Thank you!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.