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] Native stack navigator crashes on quick transitions

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
kmagieracommented, Feb 17, 2020

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.

1reaction
armata007commented, Feb 11, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

android, crash on transition for my fragment - Stack Overflow
It looks like the problem is that before exit from fragment it does tabLayout. · It is clearly a bug on code base...
Read more >
Stack Navigator | React Navigation
Stack Navigator provides a way for your app to transition between screens ... are building for Android or iOS, do not skip this...
Read more >
Crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >
Tasks and the back stack | Android Developers
Lifecycle of a task and its back stack. Back press behavior for root launcher activities; Background and foreground tasks; Multiple activity ...
Read more >
Navigate to a destination - Android Developers
Navigate using DeepLinkRequest; Navigation and the back stack ... By using an action, you can also animate transitions between the ...
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