# Flutter local\_auth is not working below android 10

**URL:** <https://forums.kodeco.com/t/flutter-local-auth-is-not-working-below-android-10/187978>\
**Category:** Flutter\
**Created:** [June 5, 2023, 7:21am UTC](https://forums.kodeco.com/t/flutter-local-auth-is-not-working-below-android-10/187978 "2023-06-05T07:21:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harikrishna007](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@harikrishna007](https://forums.kodeco.com/u/harikrishna007)\
**Post date:** [June 5, 2023, 7:21am UTC](https://forums.kodeco.com/t/flutter-local-auth-is-not-working-below-android-10/187978/1 "2023-06-05T07:21:44Z")

</div>

Hello folks,

I am trying to implement security lock in to my app using local\_auth library, but showing the following error.  
**PlatformException(NotAvailable, Security credentials not available., null, null)**

I am running the example code in android 10 with PIN/Pattern lock,any help most appreciated.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![diana85pope](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/diana85pope/32/110937_2.png) [@diana85pope](https://forums.kodeco.com/u/diana85pope)\
**Post date:** [February 18, 2025, 8:13am UTC](https://forums.kodeco.com/t/flutter-local-auth-is-not-working-below-android-10/187978/3 "2025-02-18T08:13:32Z")

</div>

Hello,  
Hi there,

The error you’re encountering with the local\_auth library on Android 10 is a known issue, especially on devices without biometric hardware. Here are a few steps you can take to troubleshoot and resolve the issue:

Check Biometric Availability: Ensure that the device supports biometric authentication. If not, the local\_auth library might not function as expected.

Update Dependencies: Make sure you are using the latest version of the local\_auth library. You can update your dependencies by running:

bash  
flutter pub upgrade  
Modify Authentication Logic: If the device does not have biometric hardware, you can modify the authentication logic to fall back to device credentials (PIN/Pattern). Here’s an example of how to handle this:

dart  
import ‘package:local\_auth/local\_auth.dart’;

final LocalAuthentication auth = LocalAuthentication();

Future authenticate() async {  
bool canCheckBiometrics = await auth.canCheckBiometrics;  
bool isDeviceSupported = await auth.isDeviceSupported();

if (canCheckBiometrics || isDeviceSupported) {  
try {  
bool authenticated = await auth.authenticate(  
localizedReason: ‘Please authenticate to access this feature’,  
options: const AuthenticationOptions(  
useErrorDialogs: true,  
stickyAuth: true,  
),  
);  
if (authenticated) {  
// Authentication successful  
} else {  
// Authentication failed  
}  
} on PlatformException catch (e) {  
if (e.code == ‘NotAvailable’) {  
// Handle the case where biometric authentication is not available  
// You can fall back to device credentials here  
}  
}  
} else {  
// Device does not support biometric authentication  
// You can fall back to device credentials here  
}  
}  
Check Device Settings: Ensure that the device has a PIN/Pattern lock set up. The local\_auth library requires the device [red humana grupo éxito](https://www.redhumana.com.co) to have some form of security credentials.

Test on Different Devices: If possible, test the app on different devices to see if the issue is specific to a particular device or model.

Best Regard  
Diana
