Skip to content

IllegalStateException: Can not perform this action after onSaveInstanceState #15

@grenouille-de-verre

Description

@grenouille-de-verre

Description of the bug

Exception is thrown on some devices when trying invoke AndroidRuntimePermissions.RequestPermissionsAsync. I call CheckPermissions before request. I couldn't reproduce this, I see exceptions only in metrics.

Reproduction steps

If possible, providing reproduction steps would be very helpful while pinpointing the issue. You can also post screenshots if you think they would be helpful.

Platform specs

Please provide the following info if this is a Unity 3D repository.

  • Unity version: 2021.3.21f1
  • Platform: Android
  • Device: different Android versions Samsung has 40% cases;
  • How did you download the plugin: Package Manager, latest version

Additional info

Message: AndroidJavaException: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
Exception: java.lang.Throwable: 
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1898)
android.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1921)
android.app.BackStackRecord.commitInternal(BackStackRecord.java:688)
android.app.BackStackRecord.commit(BackStackRecord.java:646)
com.yasirkula.unity.RuntimePermissions.RequestPermission(RuntimePermissions.java:112)
com.unity3d.player.UnityPlayer.nativeRender(Native Method)
com.unity3d.player.UnityPlayer.access$500(Unknown Source:0)
com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:126)
android.os.Handler.dispatchMessage(Handler.java:106)
android.os.Looper.loop(Looper.java:219)
com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
UnityEngine.AndroidJNISafe.CheckException ()
UnityEngine.AndroidJavaObject._CallStatic (System.String methodName, System.Object[] args)
AndroidRuntimePermissions.RequestPermissionsAsync (System.String[] permissions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions