简体   繁体   中英

E/AndroidRuntime: FATAL EXCEPTION: main java.lang.VerifyError

Guys I am getting the below error in RunTime, what is the root cause of this error?

java.lang.VerifyError: appPackageName at java.lang.Class.newInstanceImpl(Native Method)
                                                                          at java.lang.Class.newInstance(Class.java:1130)
                                                                          at android.app.ActivityThread.handleCreateService(ActivityThread.java:2698)
                                                                          at android.app.ActivityThread.access$1900(ActivityThread.java:148)
                                                                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1413)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                          at android.os.Looper.loop(Looper.java:137)
                                                                          at android.app.ActivityThread.main(ActivityThread.java:5457)
                                                                          at java.lang.reflect.Method.invokeNative(Native Method)

You are probably using or accessing something which is simply supported in higher android SDK, as the error shows here java.lang.Class.newInstanceImpl(Native Method) . I happened to have the same kind of VerifyError while I was using String.isEmplty(); . It seems you have same kind of problem as the message showing error in java.lang.Class

Thrown when the "verifier" detects that a class file, though well formed, contains some sort of internal inconsistency or security problem.

Here is official docs

Possible causes:

  1. You might have imported something which is using different support v4/v7 library version.

  2. You are targeting something from a higher SDK version. In that case, update your support repository and SDK build version.

Thanks everyone for your support and answers, may be your answers are right but in my case I used extra variables in one method while I was testing, so this exception appeared. Now I get rid of redundant things in my code and it start working. It may help others.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM