QuickPermissions / QuickPermissions-Kotlin

The most easiest way to handle Android Runtime Permissions in Kotlin
Apache License 2.0
317 stars 40 forks source link

java.lang.IllegalStateException: FragmentManager is already executing transactions #18

Open dkshin opened 4 years ago

dkshin commented 4 years ago

java.lang.IllegalStateException: FragmentManager is already executing transactions

Use the Navigation component in Android Jetpack

zakayothuku commented 4 years ago

java.lang.IllegalStateException: FragmentManager is already executing transactions

Am getting this error in Jetpack Navigation Component when I use a BottomView inside a Fragment.

Autocrab commented 4 years ago

library version 0.4.1

Also using navigation component

java.lang.IllegalStateException: FragmentManager is already executing transactions
        at androidx.fragment.app.FragmentManager.ensureExecReady(FragmentManager.java:1778)
        at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1843)
        at androidx.fragment.app.FragmentManager.executePendingTransactions(FragmentManager.java:489)
        at com.livinglifetechway.quickpermissions_kotlin.PermissionsManagerKt.runWithPermissionsHandler(PermissionsManager.kt:88)
        at com.livinglifetechway.quickpermissions_kotlin.PermissionsManagerKt.runWithPermissions(PermissionsManager.kt:35)
        at com.livinglifetechway.quickpermissions_kotlin.PermissionsManagerKt.runWithPermissions$default(PermissionsManager.kt:32)
        at uz.sapphire.stepcounter.mvvm.GoogleSignInFragment.googleSignInQ(GoogleSignInFragment.kt:49)
        at uz.sapphire.stepcounter.mvvm.GoogleSignInFragment.onViewCreated(GoogleSignInFragment.kt:42)
KonnorTimmons1297 commented 4 years ago

I am getting this error as well

KonnorTimmons1297 commented 4 years ago

Actually just figured it out, runWithPermissions is being run at the same time as Navigation Components is replacing the current fragment. To fix the issue, I just created a new Handler and posted runWithPermissions:

Handler().post { runWithPermissions(...) }
fazal88 commented 3 years ago

i have nav graph inside a bottomsheetfragment then transact FragmenA to FragmentB on doing same transaction again. getting error java.lang.IllegalStateException: FragmentManager is already executing transactions. can't fid solution

NativeDevlopment commented 1 year ago

i am getting this error as well