问题
I am trying to use BiometricPrompt to use fingerprint sensor for authentication. My minimum supported sdk is 23 (Android M).
It works on all android version I tested except for marshmallow.
In marshmallow when I try to use authenticate method on button click it calls onAuthenticationError
method from BiometricPrompt.AuthenticationCallback
and it gives error code ERROR_HW_NOT_PRESENT
and error messsage:
This device does not have a fingerprint sensor
even when device have fingerprint sensor and it also has one or more fingerprint added to it.
I have added permission/feature in AndroidManifest.xml
.
I am using jetpack library for above this.
implementation 'androidx.biometric:biometric:1.0.0-alpha04'
回答1:
This has been resolved in beta01, this bug to be exact:
Fixed inconsistent behavior on API Levels 23 to 27. (b/124066957)
来源:https://stackoverflow.com/questions/56545145/biometric-prompt-not-displayed-on-android-6