Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter local_auth issues on android certain devices

I'm currently having issues with local_auth on certain devices: LG-G6 (Android 7.0) and Samsung Galaxy J7 Pro (Both running on android 7), and i believe there's more android devices having this issue.

Authentication always fails on the authenticateWithBiometrics function:

//Always failes here:

var localAuth = LocalAuthentication(); bool didAuthenticate = await localAuth.authenticateWithBiometrics( localizedReason: 'Please authenticate.');

But again, it's only failing on the above mentioned devices. I checked on 3 project that are currently using local auth and they also failing, even the developers of those projects where not aware.

Is this a known issue?

like image 327
Tshepo Sibiya Avatar asked Nov 18 '25 10:11

Tshepo Sibiya


1 Answers

Inside the Android project, on styles.xml

i replaced:

<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">

With:

<style name="LaunchTheme" parent="Theme.AppCompat.Light.NoActionBar">

After debugging the app with the devices that had issues i realised that it was throwing a platform exception and complaining about the Theme.AppCompat that is missing.

Hope this helps anyone who faces the same issue

like image 53
Tshepo Sibiya Avatar answered Nov 21 '25 07:11

Tshepo Sibiya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!