Error While using FIngerprintManager android API
<p>I am trying to use the new Fingerprint Scan feature on android. I followed the google's example from here:
<a href="https://github.com/googlesamples/android-FingerprintDialog" rel="nofollow">https://github.com/googlesamples/android-FingerprintDialog</a></p>

<p>But when I run my program I get this error:</p>

<pre><code>04-12 22:51:06.475 9218-9218/ivote.android.gj.ivote E/AndroidRuntime: FATAL EXCEPTION: main
                                                                      Process: ivote.android.gj.ivote, PID: 9218
                                                                      java.lang.NoClassDefFoundError: Failed resolution of: Landroid/hardware/fingerprint/FingerprintManager;
                                                                          at ivote.android.gj.ivote.ActivityPackage.HomeScreen.fingerScan(HomeScreen.java:233)
                                                                          at ivote.android.gj.ivote.ActivityPackage.HomeScreen$7.onResponse(HomeScreen.java:188)
                                                                          at ivote.android.gj.ivote.ActivityPackage.HomeScreen$7.onResponse(HomeScreen.java:176)
                                                                          at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:60)
                                                                          at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:30)
                                                                          at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:99)
                                                                          at android.os.Handler.handleCallback(Handler.java:739)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                          at android.os.Looper.loop(Looper.java:135)
                                                                          at android.app.ActivityThread.main(ActivityThread.java:5383)
                                                                          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:939)
                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:734)
                                                                       Caused by: java.lang.ClassNotFoundException: Didn't find class "android.hardware.fingerprint.FingerprintManager" on path: DexPathList[[zip file "/data/app/ivote.android.gj.ivote-2/base.apk"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]]
                                                                          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 ivote.android.gj.ivote.ActivityPackage.HomeScreen.fingerScan(HomeScreen.java:233) 
                                                                          at ivote.android.gj.ivote.ActivityPackage.HomeScreen$7.onResponse(HomeScreen.java:188) 
                                                                          at ivote.android.gj.ivote.ActivityPackage.HomeScreen$7.onResponse(HomeScreen.java:176) 
                                                                          at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:60) 
                                                                          at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:30) 
                                                                          at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:99) 
                                                                          at android.os.Handler.handleCallback(Handler.java:739) 
                                                                          at android.os.Handler.dispatchMessage(Handler.java:95) 
                                                                          at android.os.Looper.loop(Looper.java:135) 
                                                                          at android.app.ActivityThread.main(ActivityThread.java:5383) 
                                                                          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:939) 
                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:734) 
                                                                        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
</code></pre>

<p>I tried to find the solution of this issue on google, but it didn't help. Few SO question pointed out mistake n gradle file, so my app gradle file looks like this:</p>

<pre><code>apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "ivote.android.gj.ivote"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    jcenter()
    mavenCentral()
    maven { url "https://jitpack.io" }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.android.support:support-v4:23.1.1'
    compile "com.android.support:support-v13:23.1.1"
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile project(path: ':volley')
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile 'com.github.PhilJay:MPAndroidChart:v2.2.3'
    compile 'com.journeyapps:zxing-android-embedded:3.0.2@aar'
    compile 'com.google.zxing:core:3.2.0'
}
</code></pre>

<p>I am trying to solve this error for a while, so please if any one can help it would be great help. Thanks in Advance!</p>