问题描述
'androidx.biometric:biometric:1.0.0-alpha03'
一切正常,但是当我使用最新的'androidx.biometric:biometric:1.0.0-alpha04'
构建项目并调用myBiometricPrompt.authenticate(promptInfo)
时,会引发以下异常:FragmentManager is already executing transactions
.
Everything works fine with 'androidx.biometric:biometric:1.0.0-alpha03'
, however when I build my project with the latest 'androidx.biometric:biometric:1.0.0-alpha04'
and call myBiometricPrompt.authenticate(promptInfo)
it throws this exception: FragmentManager is already executing transactions
.
这是堆栈跟踪:
java.lang.IllegalStateException: FragmentManager is already executing transactions
at androidx.fragment.app.FragmentManagerImpl.ensureExecReady(FragmentManager.java:2207)
at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2267)
at androidx.fragment.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:814)
at androidx.biometric.BiometricPrompt.authenticateInternal(BiometricPrompt.java:525)
at androidx.biometric.BiometricPrompt.authenticate(BiometricPrompt.java:465)
at com.my.app.ui.LoginFragment.handleTouchIdAuth(LoginFragment.kt:161)
at com.my.app.ui.LoginFragment.onViewCreated(LoginFragment.kt:62)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1471)
at androidx.fragment.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2646)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2416)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2372)
at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3273)
at androidx.fragment.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:2466)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1483)
at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269)
at androidx.fragment.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:620)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1391)
at android.app.Activity.performStart(Activity.java:7157)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2937)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
有人知道发生了什么事和怎么做吗?现在,我将继续使用版本 1.0.0-alpha03
Does anyone know what happened and what to do? For now, I'll stick with version 1.0.0-alpha03
谢谢!
推荐答案
该问题似乎已解决,请参见@ olearyj234的注释/答案以获取使用beta01及更高版本解决该问题的正确方法.
The issue seems to be resolved, see @olearyj234's comment/answer for the correct way to reolve the issue with beta01 and newer.
-
alpha04似乎有问题,恢复为alpha03即可解决.猜猜我们将不得不等待alpha05才能升级.
There seems to be an issue with alpha04, reverting to alpha03 fixes it.Guess we'll have to wait for alpha05 before upgrading.
只希望Google等到生物识别库超出alpha版本,然后才弃用指纹库...
Just wish Google had waited until the biometrics library was out of alpha before deprecating the fingerprint library...
这篇关于将androidx生物识别更新为1.0.0-alpha04后,Android崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!