You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fatal Exception: java.lang.IllegalStateException Fragment InvisibleFragment{61f0dec} (1438b1b4-0fad-454d-a883-60ca7cdecc62) not attached to a context.
#269
Open
ratelxu opened this issue
Nov 23, 2023
· 3 comments
@guolindev Here I am facing the crash in Android 10 when user select Keep and don't ask again in location permission request alert. Let me know if you need my help to related to this issue.
Crash logs:
16:04:02.646 E FATAL EXCEPTION: main
java.lang.IllegalStateException: Fragment InvisibleFragment{c498b7} (35fd3852-f57a-4e4f-83cc-80c81bdb8c79) not attached to a context.
at androidx.fragment.app.Fragment.requireContext(Fragment.java:972)
at com.permissionx.guolindev.request.InvisibleFragment.onRequestNormalPermissionsResult(InvisibleFragment.kt:354)
at com.permissionx.guolindev.request.InvisibleFragment.access$onRequestNormalPermissionsResult(InvisibleFragment.kt:40)
at com.permissionx.guolindev.request.InvisibleFragment$requestNormalPermissionLauncher$1$1.invoke(InvisibleFragment.kt:60)
at com.permissionx.guolindev.request.InvisibleFragment$requestNormalPermissionLauncher$1$1.invoke(InvisibleFragment.kt:59)
at com.permissionx.guolindev.request.InvisibleFragment.postForResult$lambda-10(InvisibleFragment.kt:685)
at com.permissionx.guolindev.request.InvisibleFragment.$r8$lambda$XljQbwXL656S_Z-v9CKWNCKNlCI(Unknown Source:0)
at com.permissionx.guolindev.request.InvisibleFragment$$ExternalSyntheticLambda0.run(Unknown Source:2)
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:7397)
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:935)
com.permissionx.guolindev.request.InvisibleFragment类中onRequestNormalPermissionsResult回调中使用requireContext,会导致此异常,能否在回调中不要使用requireContext或者增加一些判断,起码保证不会crash
The text was updated successfully, but these errors were encountered: