question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App crash: "java.lang.IllegalArgumentException: You cannot start a load for a destroyed activity"

See original GitHub issue

Description

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:open
  • Created 5 years ago
  • Reactions:18
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
linguokun1commented, Oct 24, 2018

I meet the same problem. Help

2reactions
n1ru4lcommented, Sep 19, 2018

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

You cannot start a load for a destroyed activity in relativelayout ...
I have solved this to passing the Application context memory behalf of current Class context memory. May be it will help you :-...
Read more >
You cannot start a load for a destroyed activity #1484 - GitHub
Yes? You cannot start a load for a destroyed activity. There's no better way of saying it. If the activity is destroyed it...
Read more >
android.app.Activity.isDestroyed java code examples - Tabnine
private static boolean isActivityDestroyed(Activity activity) { if ... If we cannot guarantee that the activity is not destroyed we prefer to assume that...
Read more >
Glide异常:Crash when activity is destroyed - CSDN博客
Fatal Exception : java.lang.IllegalArgumentException: You cannot start a load for a destroyed activity ; at · assertNotDestroyed ...
Read more >
You cannot start a load for a destroyed activity解决方案 ...
Android java.lang.IllegalArgumentException: You cannot start a load for a destroyed activity解决方案 ... 原因是:当你的Activity重新创建并且Glide中 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found