Fixed
Status Update
Comments
ve...@google.com <ve...@google.com>
ve...@google.com <ve...@google.com> #2
Thank you for reporting this issue. For us to further investigate this issue, please provide the following additional information:
Android build
Which Android build are you using? (e.g. OPP1.170223.012)
Steps to reproduce
What steps are needed to reproduce this issue?
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Expected output
What is the expected output?
Current output
What is the current output?
Android bug report capturing
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach the bug report file to this issue.
Alternate method
After reproducing the issue, navigate to “developer settings”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Screen capture of the issue
Press the volume down and power buttons simultaneously. The image will appear in your gallery. Attach the screenshot file to this issue.
Screen record of the issue, for clarity
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
Note: Please upload the files to google drive and share the folder to android-bugreport@google.com, then share the link here.
Android build
Which Android build are you using? (e.g. OPP1.170223.012)
Steps to reproduce
What steps are needed to reproduce this issue?
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Expected output
What is the expected output?
Current output
What is the current output?
Android bug report capturing
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach the bug report file to this issue.
Alternate method
After reproducing the issue, navigate to “developer settings”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Screen capture of the issue
Press the volume down and power buttons simultaneously. The image will appear in your gallery. Attach the screenshot file to this issue.
Screen record of the issue, for clarity
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
Note: Please upload the files to google drive and share the folder to android-bugreport@google.com, then share the link here.
ja...@gmail.com <ja...@gmail.com> #3
Library line:
https://github.com/aosp-mirror/platform_frameworks_support/blob/9eb33166829bec83bec750b535ab978ff5dcf8df/biometric/src/main/java/androidx/biometric/BiometricPrompt.java#L172
It seems that some device manufacturer passes the string errString as null.
The library marks that field with @NonNull and this causes crashes at runtime.
Library code:
public abstract static class AuthenticationCallback {
/**
* Called when an unrecoverable error has been encountered and the operation is complete.
* No further actions will be made on this object.
* @param errorCode An integer identifying the error message. The error message will usually
* be one of the BIOMETRIC_ERROR constants.
* @param errString A human-readable error string that can be shown on an UI
*/
public void onAuthenticationError(@BiometricError int errorCode,
@NonNull CharSequence errString) {}
/**
* Called when a biometric is recognized.
* @param result An object containing authentication-related data
*/
public void onAuthenticationSucceeded(@NonNull AuthenticationResult result) {}
/**
* Called when a biometric is valid but not recognized.
*/
public void onAuthenticationFailed() {}
}
Runtime exception:
Fatal Exception: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter errString
at com.example$callback$1.onAuthenticationError(Unknown Source:3)
at androidx.biometric.BiometricFragment$2$1.run(BiometricFragment.java:82)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6981)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
Artifact used: androidx.biometric:biometric:1.0.0-alpha03
Devices/Android versions reproduced on: (found with Crashlytics)
Samsung SM-G965F / Android 9
Samsung SM-G960F / Android 9
Samsung SM-N960F / Android 9
Steps to reproduce: unknown
Frequency: unknown
It seems that some device manufacturer passes the string errString as null.
The library marks that field with @NonNull and this causes crashes at runtime.
Library code:
public abstract static class AuthenticationCallback {
/**
* Called when an unrecoverable error has been encountered and the operation is complete.
* No further actions will be made on this object.
* @param errorCode An integer identifying the error message. The error message will usually
* be one of the BIOMETRIC_ERROR constants.
* @param errString A human-readable error string that can be shown on an UI
*/
public void onAuthenticationError(@BiometricError int errorCode,
@NonNull CharSequence errString) {}
/**
* Called when a biometric is recognized.
* @param result An object containing authentication-related data
*/
public void onAuthenticationSucceeded(@NonNull AuthenticationResult result) {}
/**
* Called when a biometric is valid but not recognized.
*/
public void onAuthenticationFailed() {}
}
Runtime exception:
Fatal Exception: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter errString
at com.example$callback$1.onAuthenticationError(Unknown Source:3)
at androidx.biometric.BiometricFragment$2$1.run(BiometricFragment.java:82)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6981)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
Artifact used: androidx.biometric:biometric:1.0.0-alpha03
Devices/Android versions reproduced on: (found with Crashlytics)
Samsung SM-G965F / Android 9
Samsung SM-G960F / Android 9
Samsung SM-N960F / Android 9
Steps to reproduce: unknown
Frequency: unknown
ve...@google.com <ve...@google.com>
kc...@google.com <kc...@google.com> #4
Hmm, looks like the only way to resolve this is to
Two options:
1) API change - remove the @nonnull annotation from androidx.biometrics, since BiometricPrompt doesn't require the error string in AuthenticationCallback#onError to be @nonnull (which is OK since we're still in alpha)
2) look for null messages in onError (and also double check other callbacks for same issue), and have a default string like "Unknown error " + error + ", try again later" if we receive a null string
jaggies@ any preference?
Josh do you have cycles to take a look?
Two options:
1) API change - remove the @nonnull annotation from androidx.biometrics, since BiometricPrompt doesn't require the error string in AuthenticationCallback#onError to be @nonnull (which is OK since we're still in alpha)
2) look for null messages in onError (and also double check other callbacks for same issue), and have a default string like "Unknown error " + error + ", try again later" if we receive a null string
jaggies@ any preference?
Josh do you have cycles to take a look?
jo...@google.com <jo...@google.com> #5
Ya I think I should have some cycles for this one.
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit ae037b86a117b0827f88a99fdfea99842ba3950b
Author: joshmccloskey <joshmccloskey@google.com>
Date: Wed Jan 23 20:32:40 2019
Added extra check for null string.
Bug: 123167217
Test: It builds.
Change-Id: I9919e2fe2bcc4d5d9c19e2f6e8201f54ff01f74a
M biometric/res/values/strings.xml
M biometric/src/main/java/androidx/biometric/BiometricFragment.java
https://android-review.googlesource.com/883814
https://goto.google.com/android-sha1/ae037b86a117b0827f88a99fdfea99842ba3950b
Branch: androidx-master-dev
commit ae037b86a117b0827f88a99fdfea99842ba3950b
Author: joshmccloskey <joshmccloskey@google.com>
Date: Wed Jan 23 20:32:40 2019
Added extra check for null string.
Bug: 123167217
Test: It builds.
Change-Id: I9919e2fe2bcc4d5d9c19e2f6e8201f54ff01f74a
M biometric/res/values/strings.xml
M biometric/src/main/java/androidx/biometric/BiometricFragment.java
Description
Artifact used
Version used: androidx.biometric:biometric:1.0.0-alpha03
Devices/Android versions reproduced on:
Samsung SM-G965F / Android 9
Samsung SM-G960F / Android 9
Samsung SM-N960F / Android 9
- Relevant code to trigger the issue.
```
override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {
// ... my code
}
```
bytecode generated:
```
public onAuthenticationError(ILjava/lang/CharSequence;)V
@Lorg/jetbrains/annotations/NotNull;() // invisible, parameter 1
L0
ALOAD 2
LDC "errString"
INVOKESTATIC kotlin/jvm/internal/Intrinsics.checkParameterIsNotNull (Ljava/lang/Object;Ljava/lang/String;)V
// .. my code
```
cause exception:
```
Fatal Exception: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter errString
at com.example$callback$1.onAuthenticationError(Unknown Source:3)
at androidx.biometric.BiometricFragment$2$1.run(BiometricFragment.java:82)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6981)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
```