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.

Android Preload Crash

See original GitHub issue

Hi,

Some android users are experiencing crashes when trying to preload android. here’s the stacktrace from Fabric

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Activity.runOnUiThread(java.lang.Runnable)' on a null object reference
       at com.dylanvann.fastimage.FastImageViewModule.preload(FastImageViewModule.java:36)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:374)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:751)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
       at android.os.Looper.loop(Looper.java:154)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
       at java.lang.Thread.run(Thread.java:761)

This is not happening for all users or all devices. And doesn’t seems to be the memory issue

Any idea how to go about fixing this?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
vishal-android-freakcommented, Jul 8, 2019

@rochapablo I am also getting this on some devices. Specifically saw this coming from Nexus 5X. Any help?

1reaction
DylanVanncommented, Apr 25, 2018

Checking for null activity has been merged, thank you @Kouznetsov

For future reference this seems to happen when a preload is called from JS, and then the native activity becomes null. In this case we just do not perform the preloading.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Checkout.preload() crashing while integrating Razorypay in ...
I am integrating Razorpay payment gateway in my app. When I do Checkout.preload(cotnext) ths app crashes. Following is the logcat of the app ......
Read more >
Randomly Crashing in Android : r/OpenMW - Reddit
Preload is made to keep everything smooth, but it requires memory. I had to decrease preload values to make gameplay crash-free. The most ......
Read more >
Fix "Aw, Snap!" page crashes and other page loading errors
Open the page in an Incognito window. On your Android phone or tablet, open the Chrome app Chrome . Tap More More and...
Read more >
App works in editor, crash at Unity preloading on Android
Hello, I have no idea about what to do. Please, any clue? Android logcat for the crash: 12/11 18:26:00.581 9624 9920 Error Unity:...
Read more >
Preloading WebView libraries on Android 5.0+ - Google Groups
... as soon as my code tried to inflate another WebView object back on the UI thread, the app crashed (stack trace below)....
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