react-native: (Android) Crash on react-native 0.49.5 (RuntimeExceptionSimpleSettableFuture)

Is this a bug report?

Yes

Environment

There was a crash on one of our Android users devices (Samsung SM-T110 Android 4.2.2 API 17) while they were using the production version of our app and we received this bug report from their device:

Environment:
  OS: macOS Sierra 10.12.6
  Node: 8.9.1
  Yarn: 1.0.2
  npm: 5.5.1
  Watchman: 3.9.0
  Xcode: Xcode 9.1 Build version 9B55
  Android Studio: 3.0 AI-171.4408382

Packages: (wanted => installed)
  react: 16.0.0-beta.5 => 16.0.0-beta.5
  react-native: 0.49.5 => 0.49.5

Steps to Reproduce

Here’s the exact stack trace:

java.lang.RuntimeException java.lang.InterruptedException 
    SimpleSettableFuture.java:102 com.facebook.react.common.futures.SimpleSettableFuture.getOrThrow
    MessageQueueThreadImpl.java:199 com.facebook.react.bridge.queue.MessageQueueThreadImpl.startNewBackgroundThread
    MessageQueueThreadImpl.java:146 com.facebook.react.bridge.queue.MessageQueueThreadImpl.create
    ReactQueueConfigurationImpl.java:87 com.facebook.react.bridge.queue.ReactQueueConfigurationImpl.create
    CatalystInstanceImpl.java:105 com.facebook.react.bridge.CatalystInstanceImpl.<init>
    CatalystInstanceImpl.java:39 com.facebook.react.bridge.CatalystInstanceImpl.<init>
    CatalystInstanceImpl.java:569 com.facebook.react.bridge.CatalystInstanceImpl$Builder.build
    ReactInstanceManager.java:1015 com.facebook.react.ReactInstanceManager.createReactContext
    ReactInstanceManager.java:107 com.facebook.react.ReactInstanceManager.access$600
    ReactInstanceManager.java:832 com.facebook.react.ReactInstanceManager$4.run
    Thread.java:856 java.lang.Thread.run


Caused by: java.lang.InterruptedException
    AbstractQueuedSynchronizer.java:1277 java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly
    CountDownLatch.java:202 java.util.concurrent.CountDownLatch.await
    SimpleSettableFuture.java:66 com.facebook.react.common.futures.SimpleSettableFuture.get
    SimpleSettableFuture.java:100 com.facebook.react.common.futures.SimpleSettableFuture.getOrThrow
    MessageQueueThreadImpl.java:199 com.facebook.react.bridge.queue.MessageQueueThreadImpl.startNewBackgroundThread
    MessageQueueThreadImpl.java:146 com.facebook.react.bridge.queue.MessageQueueThreadImpl.create
    ReactQueueConfigurationImpl.java:87 com.facebook.react.bridge.queue.ReactQueueConfigurationImpl.create
    CatalystInstanceImpl.java:105 com.facebook.react.bridge.CatalystInstanceImpl.<init>
    CatalystInstanceImpl.java:39 com.facebook.react.bridge.CatalystInstanceImpl.<init>
    CatalystInstanceImpl.java:569 com.facebook.react.bridge.CatalystInstanceImpl$Builder.build
    ReactInstanceManager.java:1015 com.facebook.react.ReactInstanceManager.createReactContext
    ReactInstanceManager.java:107 com.facebook.react.ReactInstanceManager.access$600
    ReactInstanceManager.java:832 com.facebook.react.ReactInstanceManager$4.run
    Thread.java:856 java.lang.Thread.run

Here are the threads:

screen shot 2017-11-24 at 09 08 20 screen shot 2017-11-24 at 09 08 37 screen shot 2017-11-24 at 09 08 53

Actual Behavior

There was a crash

Other hints:

Here’s the breadcrumbs we got that lead to the error: screen shot 2017-11-24 at 09 12 21

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 10
  • Comments: 44 (19 by maintainers)

Most upvoted comments

ok bot…as if upgrading to the latest RN version is such an easy task…

@guyca at Wix said that they use in MainApplication.java

 @Override
    public boolean clearHostOnActivityDestroy() {
        return false;
    }

in Wix app which fixes a lot of issues when external activities/apps are launched, which might be the issue if you’re using a camera component. Has anyone of you using it in your app?

If you do decide to give it a try, you will need to change the app startup as mentioned here for Android.

https://wix.github.io/react-native-navigation/#/android-specific-use-cases?id=compatibility-with-headlessjs

I have updated my app with the above changes and trying to reproduce the bug again. Haven’t been successful yet which is a good sign I guess.

Also, I started to see this issue after I updated to RNN .295 from RNN .253. Not sure if that rings a bell for anyone else.

I believe the issue is with react-native-navigation. There is also related issue on RNN repo - https://github.com/wix/react-native-navigation/issues/2364

A word of caution, because of using clearHostOnActivityDestroy I had trouble using deep links (the splash screen would not get destroyed). Now set it back to true.