I have a DialogFragment that handles login and fingerprint authentication for my application. This fragment uses two classes that are exclusive to API 23,
As you said the problem is with that catch block
catch (KeyPermanentlyInvalidatedException exception) {
Timber.w(exception, "A new fingerprint was added to the device");
handleKeyPermanentlyInvalidated();
return false;
}
Because that exception is added on API LEVEL 23, but I don't know why the verify error is thrown at initialization time itself.
Anyway you can catch the exception using
catch (InvalidKeyExceptionexception) {
....
return false;
}
since KeyPermanentlyInvalidatedException extends InvalidKeyExceptionexception