App crash: "java.lang.IllegalArgumentException: You cannot start a load for a destroyed activity"
See original GitHub issueDescription
In the firebase I noticed that many users are facing this crash. I suppose that it is caused by react-native-fast-image component as it is probably the only component in my project using glide. Due to logs I suppose this is the problem.
Reproduce
Unfortunately I couldn’t reproduce this error. It sometimes happens randomly when user navigates to the component that uses fastimage.
Firebase Log
Exception java.lang.IllegalArgumentException: You cannot start a load for a destroyed activity com.bumptech.glide.manager.RequestManagerRetriever.assertNotDestroyed (RequestManagerRetriever.java:302) com.bumptech.glide.manager.RequestManagerRetriever.get (RequestManagerRetriever.java:148) com.bumptech.glide.manager.RequestManagerRetriever.get (RequestManagerRetriever.java:114) com.bumptech.glide.manager.RequestManagerRetriever.get (RequestManagerRetriever.java:116) com.bumptech.glide.Glide.with (Glide.java:609) com.dylanvann.fastimage.FastImageViewManager.createViewInstance (FastImageViewManager.java:59) com.dylanvann.fastimage.FastImageViewManager.createViewInstance (FastImageViewManager.java:43) com.facebook.react.uimanager.ViewManager.createView (ViewManager.java:44) com.facebook.react.uimanager.NativeViewHierarchyManager.createView (NativeViewHierarchyManager.java:224) com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute (UIViewOperationQueue.java:153) com.facebook.react.uimanager.UIViewOperationQueue$1.run (UIViewOperationQueue.java:813) com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches (UIViewOperationQueue.java:926) com.facebook.react.uimanager.UIViewOperationQueue.access$2100 (UIViewOperationQueue.java:47) com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded (UIViewOperationQueue.java:884) com.facebook.react.bridge.GuardedRunnable.run (GuardedRunnable.java:21) android.os.Handler.handleCallback (Handler.java:739) android.os.Handler.dispatchMessage (Handler.java:95) android.os.Looper.loop (Looper.java:158) android.app.ActivityThread.main (ActivityThread.java:7230) java.lang.reflect.Method.invoke (Method.java) com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)
Solution idea
I found out that people are facing similar problems loading images using glide:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:18
- Comments:13 (3 by maintainers)
Top GitHub Comments
I meet the same problem. Help
@miraan https://github.com/DylanVann/react-native-fast-image/pull/272
I maintain my own fork of this library, you could do the same (https://www.npmjs.com/package/@n1ru4l/react-native-fast-image)
yarn add react-native-fast-image@npm:@n1ru4l/react-native-fast-image@5.0.4-alpha.0
Here a diff of all changes between master and my “private” release:
https://github.com/DylanVann/react-native-fast-image/compare/master...n1ru4l:private-release