Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android crash: Can not perform this action after onSaveInstanceState #20

Closed
janicduplessis opened this issue Sep 29, 2018 · 4 comments · Fixed by #24
Closed

Android crash: Can not perform this action after onSaveInstanceState #20

janicduplessis opened this issue Sep 29, 2018 · 4 comments · Fixed by #24

Comments

@janicduplessis
Copy link
Contributor

I'm seeing this crash in production, not sure how to repro.

java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
    at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:2053)
    at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:2079)
    at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:678)
    at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:632)
    at com.swmansion.rnscreens.ScreenContainer.tryCommitTransaction(ScreenContainer.java:99)
    at com.swmansion.rnscreens.ScreenContainer.updateIfNeeded(ScreenContainer.java:173)
    at com.swmansion.rnscreens.ScreenContainer.onAttachedToWindow(ScreenContainer.java:129)
    at android.view.View.dispatchAttachedToWindow(View.java:18623)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3520)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3527)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3527)
    at android.view.ViewGroup.addViewInner(ViewGroup.java:5162)
    at android.view.ViewGroup.addView(ViewGroup.java:4953)
    at android.view.ViewGroup.addView(ViewGroup.java:4893)
    at com.facebook.react.uimanager.ViewGroupManager.addView(ViewGroupManager.java:45)
    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:914)
    at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1021)
    at com.facebook.react.uimanager.UIViewOperationQueue.access$2500(UIViewOperationQueue.java:46)
    at com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded(UIViewOperationQueue.java:979)
    at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:24)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6944)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

Seems to be some info about this crash here https://stackoverflow.com/questions/7575921/illegalstateexception-can-not-perform-this-action-after-onsaveinstancestate-wit, not sure what the ideal fix would be.

@janicduplessis
Copy link
Contributor Author

I haven't seen the crash since updating to commitAllowingStateLoss

@ujwal-setlur
Copy link

Is this similar to #17?

@ujwal-setlur
Copy link

I am not seeing this issue so far. Played with sending the app to the background, killing background apps, etc. I am using alpha14 version.

@janicduplessis
Copy link
Contributor Author

@ujwal-setlur It is different, I am using the fix from #17. I wasn't able to reproduce the crash but it happens sometimes in production.

kmagiera pushed a commit that referenced this issue Oct 11, 2018
This fixes a crash I saw in production on Android `java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState`. The fix is based on the comment here https://stackoverflow.com/questions/7575921/illegalstateexception-can-not-perform-this-action-after-onsaveinstancestate-wit.

The crash stopped happening since deploying this fix.

Fixes #20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants