Home How can I resolve this error while adding android fingerprint auth?
Reply: 1

How can I resolve this error while adding android fingerprint auth?

reddu reed
1#
reddu reed Published in 2017-09-14 05:39:51Z

I'm developing an app which is requires google fingerprint auth for login my app. My app Requires Android 4.4 and up (api level >19), but fingerprint auth added in api level 23 onwards. is it possible to make my app support fingerprint auth with the api level I mentioned 19. In my gradle I make minsdk as 19 when I put 19 it crashes and give below error. but when I change to 23 it's fine.

E/AndroidRuntime: FATAL EXCEPTION: main

Process: info.androidhive.fingerprint, PID: 15697

java.lang.NoClassDefFoundError: Failed resolution of: 
Landroid/hardware/fingerprint/FingerprintManager;

at info.androidhive.fingerprint.FingerprintActivity.onCreate(FingerprintActivity.java:45)

at android.app.Activity.performCreate(Activity.java:6010)

at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129)

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413)

at android.app.ActivityThread.access$800(ActivityThread.java:155)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)

at android.os.Handler.dispatchMessage(Handler.java:102)

at android.os.Looper.loop(Looper.java:135)

at android.app.ActivityThread.main(ActivityThread.java:5343)

at java.lang.reflect.Method.invoke(Native Method)

at java.lang.reflect.Method.invoke(Method.java:372)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)

Caused by: java.lang.ClassNotFoundException: Didn't find class "android.hardware.fingerprint.FingerprintManager" on path: DexPathList[[zip file "/data/app/info.androidhive.fingerprint-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
                                                                              at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                                              at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
                                                                              at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
                                                                              at info.androidhive.fingerprint.FingerprintActivity.onCreate(FingerprintActivity.java:45) 
                                                                              at android.app.Activity.performCreate(Activity.java:6010) 
                                                                              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129) 
                                                                              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292) 
                                                                              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413) 
                                                                              at android.app.ActivityThread.access$800(ActivityThread.java:155) 
                                                                              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) 
                                                                              at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                              at android.os.Looper.loop(Looper.java:135) 
                                                                              at android.app.ActivityThread.main(ActivityThread.java:5343) 
                                                                              at java.lang.reflect.Method.invoke(Native Method) 
                                                                              at java.lang.reflect.Method.invoke(Method.java:372) 
                                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) 
                                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) 
                                                                            Suppressed: java.lang.ClassNotFoundException: android.hardware.fingerprint.FingerprintManager
                                                                              at java.lang.Class.classForName(Native Method)
                                                                              at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
                                                                              at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
                                                                              at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                                                                                    ... 15 more
                                                                           Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
Anonymous
2#
Anonymous Reply to 2017-09-14 05:45:25Z

We cannot use FingerpintManager with api less than 23. The minSdkVersion for this FingerpintManager is 23.

If you want to use FingerpintManager in apps whose API level is less than 23, you may consider using FingerprintManagerCompat, which behaves as if no fingerprint sensors are available with API level less than 23.

For more info check link and also example.

https://developer.android.com/reference/android/support/v4/hardware/fingerprint/FingerprintManagerCompat.html

https://github.com/AMykich/Android-Fingerprint-API
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.299697 second(s) , Gzip On .

© 2016 Powered by cudou.com design MATCHINFO