Justus Cook
Justus Cook

Reputation: 11

React native app always crashes when first opened, work every time after that

I get this crash log in console. I thought it was just a weird dev bug. I would try to launch the app, it would give this error, then I would launch again and it would load fine. I am using Expo and the app has the same crash behavior in TestFlight testing on iOS. I haven't been about to find much searching for solutions. any help is appreciated.

java.lang.IllegalStateException: Unable to attach a rootView to ReactInstance when UIManager is not properly initialized.
  com.facebook.react.ReactInstanceManager.attachRootViewToInstance(ReactInstanceManager.java:1245)
  com.facebook.react.ReactInstanceManager.attachRootView(ReactInstanceManager.java:890)
  com.facebook.react.ReactRootView.attachToReactInstanceManager(ReactRootView.java:822)
  com.facebook.react.ReactRootView.onMeasure(ReactRootView.java:183)
  android.view.View.measure(View.java:25466)
  android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
  android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
  android.view.View.measure(View.java:25466)
  android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
  android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
  androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:145)
  android.view.View.measure(View.java:25466)
  android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
  android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
  android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
  android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
  android.view.View.measure(View.java:25466)
  android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
  android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
  android.view.View.measure(View.java:25466)
  android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
  android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
  android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
  android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
  android.view.View.measure(View.java:25466)
  android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
  android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
  com.android.internal.policy.DecorView.onMeasure(DecorView.java:747)
  android.view.View.measure(View.java:25466)
  android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3397)
  android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2228)
  android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2486)
  android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1952)
  android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8171)
  android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
  android.view.Choreographer.doCallbacks(Choreographer.java:796)
  android.view.Choreographer.doFrame(Choreographer.java:731)
  android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
  android.os.Handler.handleCallback(Handler.java:938)
  android.os.Handler.dispatchMessage(Handler.java:99)
  android.os.Looper.loop(Looper.java:223)
  android.app.ActivityThread.main(ActivityThread.java:7656)
  java.lang.reflect.Method.invoke(Native Method)
  com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

I think this might have to do with certain packages, I'm not sure how though. When I have this issue removing the package makes it go away, but as it runs the second time I launch the app and works as indented, I would like to figure out how to make it work.

Upvotes: 1

Views: 366

Answers (0)

Related Questions