React-native-screens: [Android] Native stack navigator crashes on quick transitions

Created on 7 Feb 2020  路  5Comments  路  Source: software-mansion/react-native-screens

I've been recently testing new react-navigation v5 with native navigation stack and it works fine in most cases but when I start moving quickly between the screens eventually app crashes. Here is a sample video and stack trace that I got in Android Studio.

2020-02-07 13:49:14.511 11275-11275/com.reactnavigationrnd E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.reactnavigationrnd, PID: 11275
    java.lang.IllegalStateException: Restarter must be created only during owner's initialization stage
        at androidx.savedstate.SavedStateRegistryController.performRestore(SavedStateRegistryController.java:58)
        at androidx.fragment.app.Fragment.performCreate(Fragment.java:2585)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:838)
        at androidx.fragment.app.FragmentManagerImpl.addAddedFragments(FragmentManagerImpl.java:2100)
        at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1874)
        at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1830)
        at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)
        at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

test_rnv5

Most helpful comment

Thank you all for your reports and comments. This issue has been resolved as of 2.0-beta.6. Please give it a try and if you still experience the issue, comment here or start a new one.

All 5 comments

We have same issue. Any idea where to start looking in the source code?

Thanks @kantorm for reporting this. Would be great if you could link a workable app that I could run to reproduce this problem.

@kmagiera here is the repo: https://github.com/armata007/rn-screens-issue-back-project if you have any issues reproducing let me know

@kmagiera here is a snack with a code that produced this error. For me, it was much easier to reproduce on an emulator than a real device.
https://snack.expo.io/@kantorm/d12b36

Thank you all for your reports and comments. This issue has been resolved as of 2.0-beta.6. Please give it a try and if you still experience the issue, comment here or start a new one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chengsokdara picture chengsokdara  路  3Comments

jeveloper picture jeveloper  路  5Comments

sibelius picture sibelius  路  3Comments

piotrfalba picture piotrfalba  路  5Comments

pvinis picture pvinis  路  5Comments