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][TimePickerDialogModule] IllegalStateException #13831

Closed
kikijhu opened this issue May 8, 2017 · 18 comments
Closed

[Android][TimePickerDialogModule] IllegalStateException #13831

kikijhu opened this issue May 8, 2017 · 18 comments
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@kikijhu
Copy link

kikijhu commented May 8, 2017

Hi, I've found 50 crashes recently on our product.
I'm not sure it's the same issue as #6228

React-Native: 0.42
Android: 7.0
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManagerImpl.java:1527) at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManagerImpl.java:1545) at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:654) at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:621) at android.support.v4.app.DialogFragment.show(DialogFragment.java:139) at com.facebook.react.modules.timepicker.TimePickerDialogModule.open(TimePickerDialogModule.java:121) at java.lang.reflect.Method.invoke(Method.java) at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:345) at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:136) at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) at android.os.Looper.loop(Looper.java:154) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) at java.lang.Thread.run(Thread.java:761)

@henrikra
Copy link

I am getting something very similar :/

java.lang.IllegalStateException Can not perform this action after onSaveInstanceState 
    FragmentManager.java:1343 android.app.FragmentManagerImpl.checkStateLoss
    FragmentManager.java:1361 android.app.FragmentManagerImpl.enqueueAction
    BackStackRecord.java:728 android.app.BackStackRecord.commitInternal
    BackStackRecord.java:704 android.app.BackStackRecord.commit
    DialogFragment.java:292 android.app.DialogFragment.dismissInternal
    DialogFragment.java:258 android.app.DialogFragment.dismiss
    DialogModule.java:120 com.facebook.react.modules.dialog.DialogModule$FragmentManagerHelper.dismissExisting
    DialogModule.java:126 com.facebook.react.modules.dialog.DialogModule$FragmentManagerHelper.showNewAlert
    DialogModule.java:256 com.facebook.react.modules.dialog.DialogModule.showAlert
    Method.java:-2 java.lang.reflect.Method.invoke
    Method.java:372 java.lang.reflect.Method.invoke
    BaseJavaModule.java:368 com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke
    JavaModuleWrapper.java:138 com.facebook.react.cxxbridge.JavaModuleWrapper.invoke
    NativeRunnable.java:-2 com.facebook.react.bridge.queue.NativeRunnable.run
    Handler.java:739 android.os.Handler.handleCallback
    Handler.java:95 android.os.Handler.dispatchMessage
    MessageQueueThreadHandler.java:31 com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage
    Looper.java:145 android.os.Looper.loop
    MessageQueueThreadImpl.java:208 com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run
    Thread.java:818 java.lang.Thread.run

@the-simian
Copy link

the-simian commented May 22, 2017

We are also seeing this. Its fairly infrequent (but regularly). I'd say about once or twice every release cycle for just one or two users, tops. I absolutely cannot reproduce it.

Here is my stack trace. java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at FragmentManager.java:1415android.app.FragmentManagerImpl.checkStateLoss FragmentManager.java:1433android.app.FragmentManagerImpl.enqueueAction BackStackRecord.java:687android.app.BackStackRecord.commitInternal BackStackRecord.java:663android.app.BackStackRecord.commit DialogFragment.java:301android.app.DialogFragment.dismissInternal DialogFragment.java:267android.app.DialogFragment.dismiss DialogModule.java:120com.facebook.react.modules.dialog.DialogModule$FragmentManagerHelper.dismissExisting DialogModule.java:126com.facebook.react.modules.dialog.DialogModule$FragmentManagerHelper.showNewAlert DialogModule.java:256com.facebook.react.modules.dialog.DialogModule.showAlert Method.java:-2java.lang.reflect.Method.invoke BaseJavaModule.java:319com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke JavaModuleWrapper.java:158com.facebook.react.cxxbridge.JavaModuleWrapper.invoke NativeRunnable.java:-2com.facebook.react.bridge.queue.NativeRunnable.run Handler.java:739android.os.Handler.handleCallback Handler.java:95android.os.Handler.dispatchMessage MessageQueueThreadHandler.java:31com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage Looper.java:168android.os.Looper.loop MessageQueueThreadImpl.java:196com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run Thread.java:818java.lang.Thread.run

Also, yes this DOES seem the same as #6228. I am not sure why it is closed by the product team.

@farazs
Copy link

farazs commented Jun 6, 2017

Same here (RN 0.42.3)

Stacktrace:

Fatal Exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
       at android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1415)
       at android.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1433)
       at android.app.BackStackRecord.commitInternal(BackStackRecord.java:687)
       at android.app.BackStackRecord.commit(BackStackRecord.java:663)
       at android.app.DialogFragment.dismissInternal(DialogFragment.java:301)
       at android.app.DialogFragment.dismiss(DialogFragment.java:267)
       at com.facebook.react.modules.dialog.DialogModule$FragmentManagerHelper.dismissExisting(DialogModule.java:120)
       at com.facebook.react.modules.dialog.DialogModule$FragmentManagerHelper.showNewAlert(DialogModule.java:126)
       at com.facebook.react.modules.dialog.DialogModule.showAlert(DialogModule.java:256)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:345)
       at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:136)
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
       at android.os.Looper.loop(Looper.java:168)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
       at java.lang.Thread.run(Thread.java:818)

@volodymyrrudyi
Copy link

+1

@gmoseson
Copy link

+1 Same stacktrace. Crash on Android 6.0.1

@chrisknepper
Copy link
Contributor

Also getting this, here is my stack trace. The common theme here seems to be calls to DialogModule.showAlert

Fatal Exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
       at android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1438)
       at android.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1456)
       at android.app.BackStackRecord.commitInternal(BackStackRecord.java:707)
       at android.app.BackStackRecord.commit(BackStackRecord.java:671)
       at android.app.DialogFragment.show(DialogFragment.java:233)
       at com.facebook.react.modules.dialog.DialogModule$FragmentManagerHelper.showNewAlert(DialogModule.java:147)
       at com.facebook.react.modules.dialog.DialogModule.showAlert(DialogModule.java:256)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.cxxbridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
       at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:751)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
       at android.os.Looper.loop(Looper.java:154)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:199)
       at java.lang.Thread.run(Thread.java:762)

@agrass
Copy link

agrass commented Aug 29, 2017

Same error with DialogModule.showAlert

@yaronlevi
Copy link

yaronlevi commented Sep 27, 2017

+1

Maybe related to Code Push

@henrikra
Copy link

@yaronlevi I don't think it is related since we are not using Code Push and we still got the error

@tomoima525
Copy link
Contributor

A question to those of you who are seeing this error. Are you guys placing ReactRootView on Fragment?

@stale
Copy link

stale bot commented Jan 7, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 7, 2018
@andycamp
Copy link

Still getting these in production. Can't reproduce.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 12, 2018
@hramos hramos added the Android label Mar 8, 2018
@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Mar 18, 2018
@react-native-bot react-native-bot added Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. labels Mar 18, 2018
@fenglu09
Copy link

Same here。

java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
	at android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1436)
	at android.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1454)
	at android.app.BackStackRecord.commitInternal(BackStackRecord.java:708)
	at android.app.BackStackRecord.commit(BackStackRecord.java:672)
	at android.app.DialogFragment.show(DialogFragment.java:230)
	at com.facebook.react.modules.dialog.DialogModule$FragmentManagerHelper.showNewAlert(DialogModule.java:147)
	at com.facebook.react.modules.dialog.DialogModule.showAlert(DialogModule.java:256)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:363)
	at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
	at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
	at android.os.Handler.handleCallback(Handler.java:754)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
	at android.os.Looper.loop(Looper.java:163)
	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
	at java.lang.Thread.run(Thread.java:760)

Android: 7.1.1 & 7.1.2
react-native: 0.48.3

@iamdurui
Copy link

iamdurui commented Jul 9, 2018

Upgraded to 0.55.4 but still got the error. Android: 7.1.2

@deepmehtait
Copy link

deepmehtait commented Jul 11, 2018

RN version: 0.54.2
Having a similar crash on Android 7.1

Fatal Exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
       at android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1434)
       at android.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1452)
       at android.app.BackStackRecord.commitInternal(BackStackRecord.java:708)
       at android.app.BackStackRecord.commit(BackStackRecord.java:672)
       at android.app.DialogFragment.show(DialogFragment.java:231)
       at com.facebook.react.modules.dialog.DialogModule$FragmentManagerHelper.showNewAlert(DialogModule.java:151)
       at com.facebook.react.modules.dialog.DialogModule$1.run(DialogModule.java:263)
       at android.os.Handler.handleCallback(Handler.java:751)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6351)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:896)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:786)

And on Android 8.0

Fatal Exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
       at android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1870)
       at android.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1893)
       at android.app.BackStackRecord.commitInternal(BackStackRecord.java:688)
       at android.app.BackStackRecord.commit(BackStackRecord.java:646)
       at android.app.DialogFragment.show(DialogFragment.java:233)
       at com.facebook.react.modules.dialog.DialogModule$FragmentManagerHelper.showNewAlert(DialogModule.java:151)
       at com.facebook.react.modules.dialog.DialogModule$1.run(DialogModule.java:263)
       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:6938)
       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)

Any work around or possible reason for crash?

@weixinfree
Copy link

the same error in our production. react-native version: 0.54.2. it happens on Android 6.0.1, 7.0,7.1.2, 8.0, 8.1.0. about 1,671 times on 972 users. most devices on Oppo, and some on Huawei. the others is rarely.

stacktrace:

  1. android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1842)
    2 android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1860)
    3 android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:650)
    4 android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:609)
    5 android.support.v4.app.DialogFragment.show(DialogFragment.java:143)
    6 com.facebook.react.modules.dialog.DialogModule$FragmentManagerHelper.showNewAlert(DialogModule.java:141)
    7 com.facebook.react.modules.dialog.DialogModule$1.run(DialogModule.java:263)
    8 android.os.Handler.handleCallback(Handler.java:742)
    9 android.os.Handler.dispatchMessage(Handler.java:95)
    10 android.os.Looper.loop(Looper.java:157)
    11 android.app.ActivityThread.main(ActivityThread.java:5571)
    12 java.lang.reflect.Method.invoke(Native Method)
    13 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
    14 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)

I am sure the Alert.showAlert() invocation is the directly reason.

@stale
Copy link

stale bot commented Oct 21, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 21, 2018
@stale
Copy link

stale bot commented Oct 28, 2018

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Oct 28, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Oct 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests