Android Question Error in BiometricManager class

Humberto

Active Member
Licensed User
Longtime User
The error occurs inside BiometricManager

I tested in
Moto G6 Plus android 9 with fingerprint and OK
LG with android 4.12 with fingerprint works
Moto G5Plus with android 8.1 with fingerprint and crash


B4X:
'This is inside BiometricManager
Public Sub CanAuthenticate As String
    Dim v As Int = Manager.RunMethod("canAuthenticate", Null)
    Select v
        Case 1
            Return "UNAVAILABLE"
        Case 11
            Return "NONE_ENROLLED"
        Case 12
            Return "NO_HARDWARE"
        Case 0
            Return "SUCCESS"
        Case Else
            Return "UNKNOWN"
    End Select
End Sub

The error occurrs in this line " Dim v As Int = Manager.RunMethod("canAuthenticate", Null)"

Error occurred on line: 30 (BiometricManager)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:131)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA$2.run(BA.java:370)
at anywheresoftware.b4a.BA.setActivityPaused(BA.java:442)
at hsp.handsfreenotes.main$ResumeMessage.run(main.java:306)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6626)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
Caused by: java.lang.SecurityException: Must have android.permission.USE_FINGERPRINT permission.: Neither user 10184 nor current process has android.permission.USE_FINGERPRINT.
at android.os.Parcel.readException(Parcel.java:2013)
at android.os.Parcel.readException(Parcel.java:1959)
at android.hardware.fingerprint.IFingerprintService$Stub$Proxy.isHardwareDetected(IFingerprintService.java:439)
at android.hardware.fingerprint.FingerprintManager.isHardwareDetected(FingerprintManager.java:814)
at androidx.core.hardware.fingerprint.FingerprintManagerCompat.isHardwareDetected(FingerprintManagerCompat.java:83)
at androidx.biometric.BiometricManager.canAuthenticate(BiometricManager.java:125)
... 18 more

I put a Try and Catch to bypass but I can not use the fingerprint
 
Last edited:
Top