[Android] Aplication crash when various navigate launched consecutively
See original GitHub issueThe crash occurs on a page with a navigation button that goes to a previous page using navigation.navigate
, when hitting the button consecutively and continue producing touch events on the new loaded screen the application crashes.
This crash does not occur when the enableScreens
is not activated.
Versions used react-native-screens : 2.0.0-alpha.29 @react-navigation/native: 5.0.0-alpha.27 @react-navigation/stack: 5.0.0-alpha.61
Java exception launched.
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:3562)
at android.view.ViewGroup.addView(ViewGroup.java:3415)
at android.view.ViewGroup.addView(ViewGroup.java:3360)
at android.view.ViewGroup.addView(ViewGroup.java:3336)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:887)
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:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:752)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:586)
at dalvik.system.NativeStart.main(NativeStart.java)
There is a workaround by disabling the button after the first call to the onPress event, but the crash can be still a problem and does not occur without enableScreens
.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:8 (6 by maintainers)
Top Results From Across the Web
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 >How to Fix It When Apps Keep Crashing on Android - Lifewire
There are many common reasons an app may keep crashing on your Android. Try these fixes to solve this common problem.
Read more >App Crashes whenever I click an Icon on Navigation bar
Just got many problems sorted out on my bottom navigation bar, but now the app crashes whenever I click on any of the...
Read more >The Google App Is Repeatedly Crashing for Android Users ...
For this, navigate to Settings > Apps > Google on your Android device and tap on the Uninstall updates option.
Read more >Why Do My Apps Keep Crashing on Android? Try these Fixes
In such conditions, when you try to launch the app again, it may freeze or crash. It is because the app wasn't closed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmm, i’ve tried starting a new project and setting listeners up for
AppState
andNetInfo
. Can’t reproduce the issue so perhaps it’s something else that doesn’t play nicely. I’ll create a new issue if i end up reproducing it again.It was definetly happening when i was asking for permissions based on connectivity / location change and then swapping from settings to application. I also swapped between stacks based on the outcome of the permissions check
I apologize for the delayed response, for me the problem went away with an update to one of the stable versions.