Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BiometricAuth.verify fails in Android #16

Open
lcpelaez opened this issue Sep 8, 2020 · 2 comments
Open

BiometricAuth.verify fails in Android #16

lcpelaez opened this issue Sep 8, 2020 · 2 comments

Comments

@lcpelaez
Copy link

lcpelaez commented Sep 8, 2020

When the Device Runs BiometricAuth.verify throws an Exception and the app crashes.

Tested on Device Motorola G5 Plus Android 8.1:

Android Studio Debug Error:

E/Capacitor: Serious error executing plugin
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99)
at com.getcapacitor.Bridge$1.run(Bridge.java:521)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/hardware/biometrics/BiometricPrompt$Builder;
at com.ahm.capacitor.biometric.BiometricAuth.displayBiometricPrompt(BiometricAuth.java:51)
at com.ahm.capacitor.biometric.BiometricAuth.verify(BiometricAuth.java:44)
at java.lang.reflect.Method.invoke(Native Method) 
at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99) 
at com.getcapacitor.Bridge$1.run(Bridge.java:521) 
at android.os.Handler.handleCallback(Handler.java:790) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:164) 
at android.os.HandlerThread.run(HandlerThread.java:65) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.hardware.biometrics.BiometricPrompt$Builder" on path: DexPathList[[zip file "/data/app/com.authtest.test-Voezn6eKdFjD322ANuCwjA==/base.apk"],nativeLibraryDirectories=[/data/app/com.authtest.test-Voezn6eKdFjD322ANuCwjA==/lib/arm, /system/lib, /system/vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.ahm.capacitor.biometric.BiometricAuth.displayBiometricPrompt(BiometricAuth.java:51) 
at com.ahm.capacitor.biometric.BiometricAuth.verify(BiometricAuth.java:44) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99) 
at com.getcapacitor.Bridge$1.run(Bridge.java:521) 
at android.os.Handler.handleCallback(Handler.java:790) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:164) 
at android.os.HandlerThread.run(HandlerThread.java:65) 
E/AndroidRuntime: FATAL EXCEPTION: CapacitorPlugins
Process: com.authtest.test, PID: 4858
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.getcapacitor.Bridge$1.run(Bridge.java:530)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99)
at com.getcapacitor.Bridge$1.run(Bridge.java:521)
at android.os.Handler.handleCallback(Handler.java:790) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:164) 
at android.os.HandlerThread.run(HandlerThread.java:65) 
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/hardware/biometrics/BiometricPrompt$Builder;
at com.ahm.capacitor.biometric.BiometricAuth.displayBiometricPrompt(BiometricAuth.java:51)
at com.ahm.capacitor.biometric.BiometricAuth.verify(BiometricAuth.java:44)
at java.lang.reflect.Method.invoke(Native Method) 
at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99) 
at com.getcapacitor.Bridge$1.run(Bridge.java:521) 
at android.os.Handler.handleCallback(Handler.java:790) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:164) 
at android.os.HandlerThread.run(HandlerThread.java:65) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.hardware.biometrics.BiometricPrompt$Builder" on path: DexPathList[[zip file "/data/app/com.authtest.test-Voezn6eKdFjD322ANuCwjA==/base.apk"],nativeLibraryDirectories=[/data/app/com.authtest.test-Voezn6eKdFjD322ANuCwjA==/lib/arm, /system/lib, /system/vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.ahm.capacitor.biometric.BiometricAuth.displayBiometricPrompt(BiometricAuth.java:51) 
at com.ahm.capacitor.biometric.BiometricAuth.verify(BiometricAuth.java:44) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99) 
at com.getcapacitor.Bridge$1.run(Bridge.java:521) 
at android.os.Handler.handleCallback(Handler.java:790) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:164) 
at android.os.HandlerThread.run(HandlerThread.java:65) 

@ZhongYueHui
Copy link

Yes, I also encountered this problem. Did you solve it? Thank you

@lcpelaez
Copy link
Author

I did not find a way, I changed the plugin to cordova-plugin-fingerprint-aio, this guys made this cordova plugin compatible with capacitor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants