Fixed
Status Update
Comments
tr...@gmail.com <tr...@gmail.com> #2
The most common devices for the first crash sorted from highest to lowest:
Samsung S8 (5% of all crashes), S9 (4%), S8+ (4%), S10+ (3%), S9+ (3%), Huawei P20 Pro & Lite (9%)
The most common devices for the second crash:
HUAWEI Y6 2019 (38% of all crashes), HUAWEI Y5 2019 (17%), Nokia 3 (10%), Nokia 2.1 (9 %), Oppo realme 1 (5%)
The most common devices for the third crash:
Samsung Galaxy A5 (14% of all crashes). S7 Edge (9%), Spa Condor Electronics PGN610 (17% of all crashes)
Samsung S8 (5% of all crashes), S9 (4%), S8+ (4%), S10+ (3%), S9+ (3%), Huawei P20 Pro & Lite (9%)
The most common devices for the second crash:
HUAWEI Y6 2019 (38% of all crashes), HUAWEI Y5 2019 (17%), Nokia 3 (10%), Nokia 2.1 (9 %), Oppo realme 1 (5%)
The most common devices for the third crash:
Samsung Galaxy A5 (14% of all crashes). S7 Edge (9%), Spa Condor Electronics PGN610 (17% of all crashes)
ga...@gtempaccount.com <ga...@gtempaccount.com> #3
Crash 3 is a dupe of issue 138825362
kc...@google.com <kc...@google.com> #4
Which library version are you using?
kc...@google.com <kc...@google.com>
ga...@gtempaccount.com <ga...@gtempaccount.com> #5
yeap, at least #1 was reported against the alpha here: https://stackoverflow.com/q/56358422/270197 - while the lib is now in beta
kc...@google.com <kc...@google.com> #6
#1 and #3 are definitely fixable in the support library. #2 can likely be resolved by the app checking BiometricManager#canAuthenticate() before requesting BiometricPrompt#authenticate().
For #1)
Looks like somehow the app is trying to display the dialog after onSaveInstanceState(), e.g. the activity/fragment is ending its lifecycle? Curtis perhaps we should do some lifecycle checks here.
For #2)
tranced.freak@ do you happen to know which devices are reporting this?
There is a chance the following is happening:
- device does not have fingerprint hardware
- app requests authenticate()
- hasSystemFeature(FP) fails, but invokes sendError
- sendError needs FPM to get error string.
A solution on the app side is to check BiometricManager#canAuthenticate() before requesting authentication. Is this something the app is already doing? We will focus this bug on #1 and #3 until we hear otherwise.
For #3)
Similar onSaveInstanceState issue
For #1)
Looks like somehow the app is trying to display the dialog after onSaveInstanceState(), e.g. the activity/fragment is ending its lifecycle? Curtis perhaps we should do some lifecycle checks here.
For #2)
tranced.freak@ do you happen to know which devices are reporting this?
There is a chance the following is happening:
- device does not have fingerprint hardware
- app requests authenticate()
- hasSystemFeature(FP) fails, but invokes sendError
- sendError needs FPM to get error string.
A solution on the app side is to check BiometricManager#canAuthenticate() before requesting authentication. Is this something the app is already doing? We will focus this bug on #1 and #3 until we hear otherwise.
For #3)
Similar onSaveInstanceState issue
kc...@google.com <kc...@google.com> #7
Edit, just read comment #2 . Y5, Nokia 3, Nokia 2.1, Realme1 don't have fingerprint sensors.
The only other device, Y6 does have a fingerprint sensor but it's possible the only other device (Y6) did not declare FEATURE_FINGERPRINT.
Either way, checking androidx.BiometricManager#canAuthenticate (added in beta01) will resolve this issue.
The only other device, Y6 does have a fingerprint sensor but it's possible the only other device (Y6) did not declare FEATURE_FINGERPRINT.
Either way, checking androidx.BiometricManager#canAuthenticate (added in beta01) will resolve this issue.
cu...@google.com <cu...@google.com>
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 549dceb1f3104bc4c4cb3e5168114f99e84a223c
Author: Curtis Belmonte <curtislb@google.com>
Date: Tue Sep 17 11:24:07 2019
Fix biometric dialog crashes due to state loss
Making fragment transactions such as adding or removing dialogs after
the host activity's state has been saved is currently causing crashes in
the biometric library. normally For multiple reasons (outlined in
b/138825362 ), allowing these dialogs to be dismissed with state loss is
probably preferable anyway, so this commit makes that change. It also
tries to prevent BiometricPrompt from triggering authentication in the
first place if the host's state has already been saved.
Test: ./gradlew biometric:connectedAndroidTest
Test: Trigger delayed dismissal of dialog and quickly finish activity
Test: Enable "Don't Keep Activities", show prompt and back out
periodically
Before: App crashes
After: App no longer crashes
Fixes: 138825362
Bug: 140447194
Change-Id: Ic2cf512c9441c2c8b83a051ff788210ae10d64b1
M biometric/src/main/java/androidx/biometric/BiometricPrompt.java
M biometric/src/main/java/androidx/biometric/FingerprintDialogFragment.java
https://android-review.googlesource.com/1122833
https://goto.google.com/android-sha1/549dceb1f3104bc4c4cb3e5168114f99e84a223c
Branch: androidx-master-dev
commit 549dceb1f3104bc4c4cb3e5168114f99e84a223c
Author: Curtis Belmonte <curtislb@google.com>
Date: Tue Sep 17 11:24:07 2019
Fix biometric dialog crashes due to state loss
Making fragment transactions such as adding or removing dialogs after
the host activity's state has been saved is currently causing crashes in
the biometric library. normally For multiple reasons (outlined in
probably preferable anyway, so this commit makes that change. It also
tries to prevent BiometricPrompt from triggering authentication in the
first place if the host's state has already been saved.
Test: ./gradlew biometric:connectedAndroidTest
Test: Trigger delayed dismissal of dialog and quickly finish activity
Test: Enable "Don't Keep Activities", show prompt and back out
periodically
Before: App crashes
After: App no longer crashes
Fixes: 138825362
Bug: 140447194
Change-Id: Ic2cf512c9441c2c8b83a051ff788210ae10d64b1
M biometric/src/main/java/androidx/biometric/BiometricPrompt.java
M biometric/src/main/java/androidx/biometric/FingerprintDialogFragment.java
ga...@gtempaccount.com <ga...@gtempaccount.com> #9
are these fixes released in beta02?
cu...@google.com <cu...@google.com> #10
> are these fixes released in beta02?
Unfortunately no, but fixes for (1) and (3) from comment #2 will be in rc01, which should be released very soon. :-)
As kchyn@google.com said, an app-side solution is probably most appropriate for (2).
Unfortunately no, but fixes for (1) and (3) from
As kchyn@google.com said, an app-side solution is probably most appropriate for (2).
tr...@gmail.com <tr...@gmail.com> #11
I did use alpha version first and then upgraded to beta-02 and I had the same issues.
Unfortunately at the moment I can't use this library until the state errors will be fixed, so I use my own solution as a workaround.
Unfortunately at the moment I can't use this library until the state errors will be fixed, so I use my own solution as a workaround.
kc...@google.com <kc...@google.com> #12
Sit tight, rc01, which contains the fixes for 1 and 3 is coming in before the end of next week.
Description
Fatal Exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at androidx.fragment.app.FragmentManagerImpl.checkStateLoss + 2080(FragmentManagerImpl.java:2080)
at androidx.fragment.app.FragmentManagerImpl.enqueueAction + 2106(FragmentManagerImpl.java:2106)
at androidx.fragment.app.BackStackRecord.commitInternal + 683(BackStackRecord.java:683)
at androidx.fragment.app.BackStackRecord.commit + 637(BackStackRecord.java:637)
at androidx.fragment.app.DialogFragment.show + 144(DialogFragment.java:144)
at androidx.biometric.BiometricPrompt.authenticateInternal + 499(BiometricPrompt.java:499)
at androidx.biometric.BiometricPrompt.authenticate + 465(BiometricPrompt.java:465)
I got 500 crashes in the last 4 days containing this error (100% of devices are Android 9):
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.hardware.fingerprint.FingerprintManager.getErrorString(int, int)' on a null object reference
at android.hardware.biometrics.BiometricPrompt.lambda$sendError$0 + 490(BiometricPrompt.java:490)
at android.hardware.biometrics.-$$Lambda$BiometricPrompt$HqBGXtBUWNc-v8NoHYsj2gLfaRw.run + 6(-.java:6)
at android.os.Handler.handleCallback + 873(Handler.java:873)
at android.os.Handler.dispatchMessage + 99(Handler.java:99)
at android.os.Looper.loop + 193(Looper.java:193)
at android.app.ActivityThread.main + 6715(ActivityThread.java:6715)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 493(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main + 911(ZygoteInit.java:911)
And around 300 crashes (all of them are not Android 9):
Fatal Exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at androidx.fragment.app.FragmentManagerImpl.checkStateLoss + 2080(FragmentManagerImpl.java:2080)
at androidx.fragment.app.FragmentManagerImpl.enqueueAction + 2106(FragmentManagerImpl.java:2106)
at androidx.fragment.app.BackStackRecord.commitInternal + 683(BackStackRecord.java:683)
at androidx.fragment.app.BackStackRecord.commit + 637(BackStackRecord.java:637)
at androidx.fragment.app.DialogFragment.dismissInternal + 224(DialogFragment.java:224)
at androidx.fragment.app.DialogFragment.dismiss + 191(DialogFragment.java:191)
at androidx.biometric.FingerprintDialogFragment.handleDismissDialogError + 367(FingerprintDialogFragment.java:367)
at androidx.biometric.FingerprintDialogFragment$H.handleMessage + 102(FingerprintDialogFragment.java:102)
at android.os.Handler.dispatchMessage + 105(Handler.java:105)
at android.os.Looper.loop + 164(Looper.java:164)
at android.app.ActivityThread.main + 6942(ActivityThread.java:6942)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run + 327(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main + 1374(ZygoteInit.java:1374)
I am not doing anything specific, just calling authenticate onAttach and that's it. This is very annoying, I needed to revert the update and rollback to the old authentication method.