Fixed
Status Update
Comments
ve...@google.com <ve...@google.com>
ve...@google.com <ve...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
ja...@gmail.com <ja...@gmail.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
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)
```