plugins
plugins copied to clipboard
[@nativescript/fingerprint-auth] verifyFingerprint() no longer works with N7 and Android
The previous version the plugin was working on Android <10, but the latest version seems to be broken on Android when using NativeScript 7. Tested on Android 6 and 10.
Calling verifyFingerprint()
results in the following error:
Error in fingerprint-auth.verifyFingerprint: Error: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/security/identity/IdentityCredential;
Example:
fingerprintAuth.available().then(
function(avail) {
console.log(avail);
console.log(`Biometric ID available? ${avail.any}`); // => true
console.log(`Touch? ${avail.touch}`); // => undefined
console.log(`Face? ${avail.face}`); // => undefined
console.log(`Biometrics? ${avail.biometrics}`); // => true
if (avail.any) {
fingerprintAuth.verifyFingerprint(
{
title: 'Android title',
message: 'Scan your finger',
authenticationValidityDuration: 10,
useCustomAndroidUI: false
})
.then(() => {
console.log("Biometric ID OK")
})
.catch(err => console.log(`Biometric ID NOT OK: ${JSON.stringify(err)}`));
}
}
)
Same problem here, tested on Android 8 and 10
nativescript : 8.0.1 plugin version : 8.0.0
Is there likely to be a fix for this?
Using the previous version (7) should work
The previous version doesn't work on Android >= 10. Hence the update
The previous version works on Android >=10 it just doesn't support facial req. ( i.e. fingerprint works )
This is still a problem. Plugin version 8.0.0 NS version 8.0.1
Any updates on this?
We are seeing the same issue on NS 8,1,1, Plugin version 8.0.0. Is there any update on this?
same here, not working after upgrade from NS7 to NS8 Any update on this ?
below is the error msg
Error in fingerprint-auth.verifyFingerprint: Error: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/security/identity/IdentityCredential; verify-pin.screen.ts:120 err in fingerprintAuthService : { "code": 70, "message": { "nativeException": {}, "stackTrace": "(file:///data/data/org.abc.appname/files/app/vendor.js:121103:38)\n\tat ZoneAwarePromise(file:///data/data/org.abc.appname/files/app/vendor.js:168706:29)\n\tat verifyFingerprint(file:///data/data/org.abc.appname/files/app/vendor.js:121085:16)\n\tat verifyFingerprint(file:///data/data/org.abc.appname/files/app/src_app_directives_hide-action-bar_abcma-hide-action-bar_directive_ts-src_app_modules_shared_-a46233.js:266:37)\n\tat verifyFingerPrint(file:///data/data/org.abc.appname/files/app/src_app_modules_feature_launch_launch_module_ts.js:968:41)\n\tjava.lang.reflect.Executable.getParameterTypesInternal(Native Method)\n\tjava.lang.reflect.Constructor.getParameterTypes(Constructor.java:138)\n\tcom.tns.MethodResolver.resolveConstructor(MethodResolver.java:211)\n\tcom.tns.MethodResolver.resolveConstructorSignature(MethodResolver.java:189)\n\tcom.tns.Runtime.resolveConstructorSignature(Runtime.java:1237)\n\tcom.tns.Runtime.callJSMethodNative(Native Method)\n\tcom.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1302)\n\tcom.tns.Runtime.callJSMethodImpl(Runtime.java:1188)\n\tcom.tns.Runtime.callJSMethod(Runtime.java:1175)\n\tcom.tns.Runtime.callJSMethod(Runtime.java:1153)\n\tcom.tns.Runtime.callJSMethod(Runtime.java:1149)\n\tcom.tns.gen.java.lang.Object_vendor_92982_28_ClickListenerImpl.onClick(Object_vendor_92982_28_ClickListenerImpl.java:18)\n\tandroid.view.View.performClick(View.java:7161)\n\tandroid.view.View.performClickInternal(View.java:7133)\n\tandroid.view.View.access$3500(View.java:804)\n\tandroid.view.View$PerformClick.run(View.java:27416)\n\tandroid.os.Handler.handleCallback(Handler.java:883)\n\tandroid.os.Handler.dispatchMessage(Handler.java:100)\n\tandroid.os.Looper.loop(Looper.java:241)\n\tandroid.app.ActivityThread.main(ActivityThread.java:7617)\n\tjava.lang.reflect.Method.invoke(Native Method)\n\tcom.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)\n\tcom.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)\n\nCaused by: \tdalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)\n\tjava.lang.ClassLoader.loadClass(ClassLoader.java:379)\n\tjava.lang.ClassLoader.loadClass(ClassLoader.java:312)\n\tjava.lang.reflect.Executable.getParameterTypesInternal(Native Method)\n\tjava.lang.reflect.Constructor.getParameterTypes(Constructor.java:138)\n\tcom.tns.MethodResolver.resolveConstructor(MethodResolver.java:211)\n\tcom.tns.MethodResolver.resolveConstructorSignature(MethodResolver.java:189)\n\tcom.tns.Runtime.resolveConstructorSignature(Runtime.java:1237)\n\tcom.tns.Runtime.callJSMethodNative(Native Method)\n\tcom.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1302)\n\tcom.tns.Runtime.callJSMethodImpl(Runtime.java:1188)\n\tcom.tns.Runtime.callJSMethod(Runtime.java:1175)\n\tcom.tns.Runtime.callJSMethod(Runtime.java:1153)\n\tcom.tns.Runtime.callJSMethod(Runtime.java:1149)\n\tcom.tns.gen.java.lang.Object_vendor_92982_28_ClickListenerImpl.onClick(Object_vendor_92982_28_ClickListenerImpl.java:18)\n\tandroid.view.View.performClick(View.java:7161)\n\tandroid.view.View.performClickInternal(View.java:7133)\n\tandroid.view.View.access$3500(View.java:804)\n\tandroid.view.View$PerformClick.run(View.java:27416)\n\tandroid.os.Handler.handleCallback(Handler.java:883)\n\tandroid.os.Handler.dispatchMessage(Handler.java:100)\n\tandroid.os.Looper.loop(Looper.java:241)\n\tandroid.app.ActivityThread.main(ActivityThread.java:7617)\n\tjava.lang.reflect.Method.invoke(Native Method)\n\tcom.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)\n\tcom.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)\n" } }
ns version : 8.1.4
plugin version : 8.0.0
Got this error as well on API level < 30. From what I see this is caused when initializing a CryptoObject
here: https://github.com/NativeScript/plugins/blob/27eb1769107e7caa7216b742cd414a243761a219/packages/fingerprint-auth/index.android.ts#L120
I suspect this is a problem with the NS Android runtime while it tries to find the most suitable constructor override since there are 4 different constructors: https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.CryptoObject?hl=en#summary
It probably tries to instantiate an IdentityCredential
and since no such class exists in lower APIs the error is rethrown .
Any update on this ?
@NathanWalker @jcassidyav can you create and publish a new release with the fix you added here https://github.com/NativeScript/plugins/pull/212 ? Version 8.1.0 doesn't have this fix yet.
Issue got solved in here https://github.com/NativeScript/plugins/tree/main/packages/biometrics
switching plugin from fingerprint-auth to @nativescript/biometrics fixed it for us
Supported via the Biometrics plugin, @nativescript/fingerprint-auth is depreciated.