react-native-screens
react-native-screens copied to clipboard
IllegalStateException:getOrCreateTransaction - Android Crash on app launch
Getting some random crashes on android, the crash reported to use android ReactFragmentActivity, irrespective of the MainActivity extended from ReactFragmentActivity
public class MainActivity extends ReactFragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
}
java.lang.IllegalStateException: In order to use RNScreens components your app's activity need to extend ReactFragmentActivity or ReactCompatActivity
at com.swmansion.rnscreens.ScreenContainer.getOrCreateTransaction(ScreenContainer.java:88)
at com.swmansion.rnscreens.ScreenContainer.attachScreen(ScreenContainer.java:103)
at com.swmansion.rnscreens.ScreenContainer.updateIfNeeded(ScreenContainer.java:175)
at com.swmansion.rnscreens.ScreenContainer.onAttachedToWindow(ScreenContainer.java:127)
at android.view.View.dispatchAttachedToWindow(View.java:15535)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2918)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2925)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2925)
at android.view.ViewGroup.addViewInner(ViewGroup.java:4458)
at android.view.ViewGroup.addView(ViewGroup.java:4260)
at android.view.ViewGroup.addView(ViewGroup.java:4200)
at com.facebook.react.uimanager.ViewGroupManager.addView(ViewGroupManager.java:39)
at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:438)
at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:227)
at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:894)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1001)
at com.facebook.react.uimanager.UIViewOperationQueue.access$2400(UIViewOperationQueue.java:46)
at com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded(UIViewOperationQueue.java:959)
at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:24)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6228)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
We are getting somewhat like this error. Happens on application startup
MainActivity.java
public class MainActivity extends ReactFragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
}
...
}
Error:
Fatal Exception: java.lang.IllegalStateException: In order to use RNScreens components your app's activity need to extend ReactFragmentActivity or ReactCompatActivity
at com.swmansion.rnscreens.ScreenContainer.<init>(ScreenContainer.java:44)
at com.swmansion.rnscreens.ScreenContainerViewManager.createViewInstance(ScreenContainerViewManager.java:21)
at com.swmansion.rnscreens.ScreenContainerViewManager.createViewInstance(ScreenContainerViewManager.java:9)
at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:42)
at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:260)
at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:200)
at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:888)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1001)
at com.facebook.react.uimanager.UIViewOperationQueue.access$2400(UIViewOperationQueue.java:46)
at com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded(UIViewOperationQueue.java:959)
at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:24)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6238)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
UPD: after updating to latest version 1.0.0-alpha.22 - crash has gone
@kmagiera fixed on 1.0.0-alpha.22