sergeykomlach/AdvancedBiometricPromptCompat

IllegalStateException: No activity on screen

ymdrkh opened this issue · 2 comments

ymdrkh commented

Hello,

We faced with lot of crashes on various user devices (library version is 2.2.3):

Fatal Exception: java.lang.IllegalStateException: No activity on screen
       at dev.skomlach.biometric.compat.BiometricPromptCompat$Builder.getContext(BiometricPromptCompat.kt:890)
       at dev.skomlach.biometric.compat.BiometricPromptCompat$startAuth$checkPermissions$1$1$callback$1.onUIClosed$lambda$2(BiometricPromptCompat.kt:488)
       at dev.skomlach.common.misc.ExecutorHelper$postDelayed$job$1.invokeSuspend(ExecutorHelper.kt:85)
Fatal Exception: java.lang.IllegalStateException: No activity on screen
       at dev.skomlach.biometric.compat.BiometricPromptCompat$Builder.getContext(BiometricPromptCompat.kt:890)
       at dev.skomlach.biometric.compat.BiometricPromptCompat$startAuth$checkPermissions$1$1$callback$1.onUIClosed$lambda$2(BiometricPromptCompat.kt:488)
       at dev.skomlach.common.misc.ExecutorHelper$postDelayed$job$1.invokeSuspend(ExecutorHelper.kt:85)
Fatal Exception: java.lang.IllegalStateException: No activity on screen
       at dev.skomlach.biometric.compat.BiometricPromptCompat$Builder.getContext(BiometricPromptCompat.kt:890)
       at dev.skomlach.biometric.compat.impl.dialogs.BiometricPromptCompatDialogImpl.dismissDialog(BiometricPromptCompatDialogImpl.kt:277)
       at dev.skomlach.biometric.compat.impl.BiometricPromptGenericImpl.cancelAuthentication(BiometricPromptGenericImpl.kt:79)
       at dev.skomlach.biometric.compat.impl.BiometricPromptGenericImpl$BiometricAuthenticationCallbackImpl.onCanceled(BiometricPromptGenericImpl.kt:227)
       at dev.skomlach.biometric.compat.engine.BiometricAuthentication$authenticate$1.onCanceled(BiometricAuthentication.kt:361)
       at dev.skomlach.biometric.compat.engine.internal.fingerprint.API23FingerprintModule$AuthCallback.onAuthenticationError(API23FingerprintModule.kt:194)

Looks like code is post executed after activity being destroyed, and I suppose it should not rise any exception just check activity and skip if null.

Thanks

Yep, such errors should inform only the developer.
I'll rework this behavior ASAP

The issue should be solved ; Fix will be available in next release