biometric_storage icon indicating copy to clipboard operation
biometric_storage copied to clipboard

Getting unknown exception on android

Open itaishalom opened this issue 3 years ago • 8 comments

After the read function and the fingerprint conformation i get - AuthException{code: AuthExceptionCode.unknown, message: Unexpected authentication error. null} (Andorid) This occurs on 3.0.0. Will test it on 3.0.1 to tell if something changed. Biometric defined as -

BiometricStorage().getStorage('safe_token_repo', options: StorageFileInitOptions(authenticationValidityDurationSeconds: -1), promptInfo: const PromptInfo( androidPromptInfo: AndroidPromptInfo( title: 'Authentication', subtitle: '', description: 'Touch the fingerprint sensor', negativeButton: 'Use password', ), iosPromptInfo: IosPromptInfo( saveTitle: 'Custom save title', accessTitle: 'Enter password.', ), ));

itaishalom avatar Oct 04 '21 18:10 itaishalom

Persists on 3.0.1, android 11. Happens after the fingerprint touch. Any Ideas?

I/BiometricPrompt(27271): onAuthenticationSucceeded: 2 I/flutter (27271): AuthService: [E] AuthException{code: AuthExceptionCode.unknown, message: Unexpected authentication error. null}

Happens after the app returns from background issue, does it help?

itaishalom avatar Oct 19 '21 10:10 itaishalom

having the same issue! Any updates on this?

carlossilvaf avatar Nov 03 '21 18:11 carlossilvaf

Hmm, not really but i found out that it happens when the app resumes from the background. I added a delay of a few moments before reading from the repository and it helped.

itaishalom avatar Nov 03 '21 21:11 itaishalom

@hpoul it may be related to the app's on resume with android. Can you check what happens if the prompt is shown when the app resumes?

itaishalom avatar May 04 '22 11:05 itaishalom

@itaishalom I had the same issue, after an investigation I found a possible race condition between getting the cipher and using it, I have send a PR with my fix, perhaps you want to try it as well?

ItzikAlkotzerAidoc avatar May 23 '22 08:05 ItzikAlkotzerAidoc

Works! @hpoul can you check that PR?

itaishalom avatar May 23 '22 10:05 itaishalom

@itaishalom notice @hpoul solve the issue in branch android-executor-thread, you can check it out as well

ItzikAlkotzerAidoc avatar Jun 07 '22 13:06 ItzikAlkotzerAidoc

@hpoul Thank you for fixing this issue.

ItzikAlkotzerAidoc avatar Jun 08 '22 07:06 ItzikAlkotzerAidoc