5

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'

enter image description here

Asad Ali Choudhry
  • 4,985
  • 4
  • 31
  • 36
Sabbir
  • 51
  • 4
  • It is possible that this device does not support `FingerprintManager`, as that was brand new to the Android SDK in 6.0. You might try a test app that uses `FingerprintManager` directly and see what happens. – CommonsWare Jun 11 '19 at 13:45
  • 1
    @CommonsWare I found that BiometricPrompt uses `PackageManager` to check if device has fingerprint sensor or not, but even if my Android 6 device has fingerprint sensor, `PackageManager` is not able to detect it and informs that fingerprint sensor not detected, but in same device `FingerprintManager` is able to detect fingerprint sensor. – Sabbir Jun 12 '19 at 06:08
  • You might want to file a bug report to get this improved in the AndroidX biometrics library. Be sure to mention the specific device manufacturer and model that is giving you this behavior. – CommonsWare Jun 12 '19 at 11:12
  • Same Issue faced on my Redmi Note 3 device which having OS version 6.0.1 But I used this version lib "implementation "androidx.biometric:biometric:1.0.0" so it shows me Authentication dialog. – Avinash Shinde Feb 05 '20 at 13:04

1 Answers1

2

This has been resolved in beta01, this bug to be exact:

Fixed inconsistent behavior on API Levels 23 to 27. (b/124066957)
Kevin
  • 168
  • 11
  • it is not working , I used this version lib `implementation "androidx.biometric:biometric:1.1.0" ` Same Issue faced on my samsung Note 4 OS version 6.0.1 – mhammad alkhalaf Jul 06 '21 at 14:01