react-native-fast-image: Crash: NullPointerException on App Startup

Describe the bug App crashes on some devices because of a Nullpointer-Exception. Might be related to: https://github.com/DylanVann/react-native-fast-image/issues/165 and https://github.com/DylanVann/react-native-fast-image/issues/523

Device Brand: LGE Model: Nexus 5X Orientation: Portrait RAM free: 3.27 GB Disk free: 1.98 GB

Operating System Version: 6.0.1 Orientation: Portrait Rooted: Yes

Fatal Exception: 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 + 51(FastImageOkHttpProgressGlideModule.java:51) at com.bumptech.glide.GeneratedAppGlideModuleImpl.registerComponents + 37(GeneratedAppGlideModuleImpl.java:37) at com.bumptech.glide.Glide.initializeGlide + 273(Glide.java:273) at com.bumptech.glide.Glide.initializeGlide + 223(Glide.java:223) at com.bumptech.glide.Glide.checkAndInitializeGlide + 184(Glide.java:184) at com.bumptech.glide.Glide.get + 168(Glide.java:168) at com.bumptech.glide.Glide.getRetriever + 689(Glide.java:689) at com.bumptech.glide.Glide.with + 716(Glide.java:716) at com.dylanvann.fastimage.FastImageViewManager.createViewInstance + 51(FastImageViewManager.java:51) at com.dylanvann.fastimage.FastImageViewManager.createViewInstance + 33(FastImageViewManager.java:33) at com.facebook.react.uimanager.ViewManager.createViewInstanceWithProps + 119(ViewManager.java:119) at com.facebook.react.uimanager.ViewManager.createViewWithProps + 66(ViewManager.java:66) at com.facebook.react.uimanager.NativeViewHierarchyManager.createView + 259(NativeViewHierarchyManager.java:259) at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute + 198(UIViewOperationQueue.java:198) at com.facebook.react.uimanager.UIViewOperationQueue$1.run + 838(UIViewOperationQueue.java:838) at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches + 952(UIViewOperationQueue.java:952) at com.facebook.react.uimanager.UIViewOperationQueue.access$2200 + 44(UIViewOperationQueue.java:44) at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded + 1012(UIViewOperationQueue.java:1012) at com.facebook.react.uimanager.GuardedFrameCallback.doFrame + 29(GuardedFrameCallback.java:29) at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame + 172(ReactChoreographer.java:172) at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame + 84(ChoreographerCompat.java:84) at android.view.Choreographer$CallbackRecord.run + 856(Choreographer.java:856) at android.view.Choreographer.doCallbacks + 670(Choreographer.java:670) at android.view.Choreographer.doFrame + 603(Choreographer.java:603) at android.view.Choreographer$FrameDisplayEventReceiver.run + 844(Choreographer.java:844) at android.os.Handler.handleCallback + 739(Handler.java:739) at android.os.Handler.dispatchMessage + 95(Handler.java:95) at android.os.Looper.loop + 148(Looper.java:148) at android.app.ActivityThread.main + 5421(ActivityThread.java:5421) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run + 726(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main + 616(ZygoteInit.java:616)

To Reproduce On Startup (not all devices).

Expected behavior No error

Screenshots App crash, not available

Dependency versions

  • React Native version: 0.60.4
  • React Native Fast Image version: 7.0.2

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 23
  • Comments: 79 (2 by maintainers)

Commits related to this issue

Most upvoted comments

@DylanVann @rtroncoso The issue still persists even after upgrading to 8.1.5 version on Nexus 5x devices. https://sentry.io/share/issue/f0ab7069d2cd4e03b2d3550bea948223/

Same here. Same crash, same device, same android version, just after uploading a new version on play store, before the app was even available on store. Probably it’s one of the emulators on which they are reviewing the app.

we still receive this issue on nexus 5 devices we got the error on Sentry. Fast Image version is 8.3.2

It’s just one device among many thousands, on an old OS version. And it looks like it’s just Google review devices, not real world devices. Cut your losses and just exclude the Nexus 5X from your app’s supported devices, that’s what that list is for. There are better ways to spend development time (imho).

Issue still persists in version 8.6.3

Just don’t support the Nexus 5X

Still happening, please reopen 😃

@DylanVann can we reopen this pls

We have the exact same crash happening on Nexus 5x devices. I could not find any information in the Glide repository.

registry is somehow null in here despite of @NonNull annotation suggested by Glide: https://github.com/DylanVann/react-native-fast-image/blob/master/android/src/main/java/com/dylanvann/fastimage/FastImageOkHttpProgressGlideModule.java#L51

I wonder if a null check here would prevent those crashes? I can’t try it on my own as I don’t have a Nexus device. Could you try and check it if you have a Nexus @wsdt?

It’s just one device among many thousands, on an old OS version. And it looks like it’s just Google review devices, not real world devices. Cut your losses and just exclude the Nexus 5X from your app’s supported devices, that’s what that list is for. There are better ways to spend development time (imho).

I agree with @chichilatte, those devices are either pretty much dead by now. In the project I worked on we were very interested on these “legacy” devices because part of our target audience included “low income population” which, more often than not, would own old devices like that one.

It’s a good idea to try and support all devices, but this particular bug is more trouble than it’s worth if nobody has seen it in other, newer, devices. I wouldn’t suggest adding it to the exclusion list of the Store, but just ignoring it in your favorite crash reporting tool (Crashlytics, Bugsnag, etc.)

I’m still in development and none of my testers have a nexus. I’m sure this is a Google testing device.

Is there any fix for this?

Getting this too. Also on Nexus 5X running Android 6.0.1. Using “react-native-fast-image”: “8.1.5”

Fatal Exception: 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:51)
       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:270)
       at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:180)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:987)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:958)
       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)

Awesome, thanks for the PR @rtroncoso !

anyone fix it?

would also be great to receive some support or feedback from some devs looking at this bug

@jadonhansen Good luck with that one 😂

You’ll get used to just ignoring these crash reports. I’ve accepted it at this point. The only thing that still worries me is whether or not it affects my app store ranking, since reliability is something they are known to consider.

But yeah, getting support on this issue from the devs?

Still waiting 💀

Thanks for the tipp. I was not aware that this problem just appears on one device. For me that is not a problem then.

Still happen, please reopen “react-native-fast-image”: “8.3.2”, react-native: 0.63.3

I tried running this in a nexus 5 simulator and it didn’t crash, does any one have any idea how to debug/fix this?

Well, first step is to be able to reproduce an error. That’s something nobody has been able to do in an observable way (not happening to anyone outside of what I’d presume is Test Lab environment apparently)…

This issue is being reported by our Crashlytics, ocurring on App startup and strangely only for Nexus 5X so far:

image

So far no other devices have reported this. An interesting thing for me is the “rooted” info, Nexus 5X is reported as rooted… could it be that the underlying OS is “tampered” to the point of making Glide unstable? Our userbase has no rooted devices so far.

Stacktrace
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'd.b.a.k d.b.a.k.b(java.lang.Class, java.lang.Class, com.bumptech.glide.load.c.v)' on a null object reference
       at com.dylanvann.fastimage.FastImageOkHttpProgressGlideModule.registerComponents(FastImageOkHttpProgressGlideModule.java)
       at com.bumptech.glide.GeneratedAppGlideModuleImpl.registerComponents(GeneratedAppGlideModuleImpl.java)
       at com.bumptech.glide.Glide.getArrayPool(Glide.java)
       at com.bumptech.glide.Glide.getGlideContext(Glide.java)
       at com.bumptech.glide.Glide.checkAndInitializeGlide(Glide.java)
       at com.bumptech.glide.Glide.clearMemory(Glide.java)
       at com.bumptech.glide.Glide.getContext(Glide.java)
       at com.bumptech.glide.Glide.getBitmapPool(Glide.java)
       at com.dylanvann.fastimage.FastImageViewManager.createViewInstance(FastImageViewManager.java)
       at com.dylanvann.fastimage.FastImageViewManager.createViewInstance(FastImageViewManager.java)
       at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java)
       at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.addRootView(NativeViewHierarchyManager.java)
       at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java)
       at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java)
       at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java)
       at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java)
       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)

Our crashes has the identical environment with what @alexandru1208 described. It’s happening only on Google’s devices/emulators during the app review. They’re fortunately not rejecting the app update because of this.

Unfortunately, I don’t have one either. It’s just Firebase Crashlytics which is notifying about that issue.