Android Question biometric library error

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Using the lib and example of : https://www.b4x.com/android/forum/threads/biometricmanager-biometric-authentication.111256/
b4a 10.7 install from scratch, last SKD and so on...
Running on a S7
Pressing the Authenticate button...
Im getting the following error

How to solve this?
Thanks
 

Alberto Michelis

Well-Known Member
Licensed User
Longtime User

Yo have the ADB.exe running, open the task manager and delete it
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
It seems like a bug or a new dependency in the latest version of AndroidX.
The activity must be an AppCompat activity:
1. Main:
B4X:
#AdditionalJar: androidx.biometric:biometric
#Extends: android.support.v7.app.AppCompatActivity
#AdditionalJar: androidx.arch.core:core-runtime
#AdditionalJar: androidx.appcompat:appcompat
2. Manifest:
B4X:
AddPermission(android.permission.USE_BIOMETRIC)
AddPermission(android.permission.USE_FINGERPRINT)
SetApplicationAttribute(android:theme, "@style/MyAppTheme")
CreateResource(values, theme.xml,
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.Light">
    </style>
</resources>
)

Tested on Android 8 and 11.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Those components, however, contain only platform 30. I guess I can get the 29 from the old folder, right?
You don't need 29.

This isn't a problem with B4XPages, right?
AppCompat is indeed less recommended with B4XPages. I will post a B4XPages example.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Maybe I also should remove:

CreateResourceFromFile(Macro, Themes.DarkTheme)

from the Manifest.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…