In my Android app, I always get VerifyErrors! And I cannot figure out why. Whenever I include a external JAR, I always get VerifyErrors when I try to launch my app (except for once, when I included Apache Log4j.)
I usually get around this by taking the source of the library and adding it to my project, but I am trying to put the GData client library.
I can get this in source, but it's dependencies (mail.jar, activation.jar, servlet-api.jar) I cannot, so I get verify errors. I would like to get to the root of this problem once and for all. I looked on the internet, but they all seem to talk about incomplete class files? which I do not know of.
In
Eclipse 4.x
, if you encounter this problem, try below:I had very similar problem. I had added Apache POI jars and problem appeared when I updated to android SDK 22.3.
I had Android Private Libraries checked so this was not the common problem with android SDK. I unchecked all Apache POI jars and added one by one. I found that poi-3.9-20121203.jar should be before poi-ooxml-3.9-20121203.jar. Otherwise it will not work.
If you have tests, try commenting out this line from your
build.grade
file:For me this caused VerifyError exceptions on classes which use Java 1.7 features, particularly string switch statements.
I have coded Android API methods/class that are in SDK 2.1, and was trying to run it on Android 1.6 emulator. So i got that error.
SOLUTION: Changed it to correct emulator version.
THIS WORKED FOR ME.. Thanks.
For me it was in correlation between compileSdkVersion and buildToolsVersion. I had:
I changed it to:
If you're using Retrolambda you might have added a static method to an interface (which is only allowed in Java 8).