When I copied the following code from this developer.android.com tutorial about adding biometric authentication in your android app:
BiometricPrompt.PromptInfo promptInfo =
new BiometricPrompt.PromptInfo.Builder()
.setTitle("Biometric login for my app")
.setSubtitle("Log in using your biometric credential")
.setNegativeButtonText("Cancel")
.build();
PromptInfo is not recognized.
I have followed all the steps prior to this in the tutorial.
You need to add this dependency:
implementation 'androidx.biometric:biometric:1.0.0-rc01'
And make sure you use this import:
import androidx.biometric.BiometricPrompt;
and not
import android.hardware.biometrics.BiometricPrompt;
Update: for the current version check: https://mvnrepository.com/artifact/androidx.biometric/biometric?repo=google
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With