安卓 java。API<20的lang.VerifyError
我制作了一个支持指纹安全的应用程序。只要我在API大于API 19的API上运行,所有这些都可以正常工作。当然,自从棉花糖以来,指纹只在设备中受支持,所以我用
介绍了与指纹有关的所有内容
如果(Build.VERSION.SDK_INT>;=Build.VERSION_CODES.M){}
我得到了以下错误:
java.lang.VerifyError: com/myapp/newapp/Introduction
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at 安卓.app.Instrumentation.newActivity(Instrumentation.java:1061)
at 安卓.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
at 安卓.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at 安卓.app.ActivityThread.access$800(ActivityThread.java:135)
at 安卓.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at 安卓.os.Handler.dispatchMessage(Handler.java:102)
at 安卓.os.Looper.loop(Looper.java:136)
at 安卓.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.安卓.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.安卓.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
我随信附上了这部分代码:
try {
keyStore.load(null);
SecretKey key = (SecretKey) keyStore.getKey(KEY_NAME,
null);
cipher.init(Cipher.ENCRYPT_MODE, key);
//Return true if the cipher has been initialized successfully//
return true;
} catch (KeyPermanentlyInvalidatedException e) {
//Return false if cipher initialization failed//
return false;
} catch (KeyStoreException | CertificateException
| UnrecoverableKeyException | IOException
| NoSuchAlgorithmException | InvalidKeyException e) {
throw new RuntimeException("Failed to init Cipher", e);
}
我不知道怎么解决它
共 (0) 个答案