Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.VerifyError in Android application [duplicate]

Tags:

android

Hello I get this error every time I'm trying to open an activity

java.lang.VerifyError: com.karriapps.smartsiddur.Saharit
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1429)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)

Can someone direct me to a solution or a way to check where the problem is coming from thanks

like image 682
orelzion Avatar asked Oct 03 '11 21:10

orelzion


2 Answers

A VerifyError means your compiled bytecode is referring to something that Android cannot find. In this case, it would appear that you have a reference to a com.karriapps.smartsiddur.Saharit class that Android cannot find.

like image 177
CommonsWare Avatar answered Sep 22 '22 05:09

CommonsWare


As CommonsWare mentioned, a VerifyError means that you're trying to reference a class that Dalvik isn't able to load.

It's possible that this class is missing.

It's also possible that you're trying to use framework methods for an API level greater than what's present on the device, and therefore the class is being rejected as invalid.

Try setting your compiler's build level to API Level 7, which corresponds to Android 2.1. (Don't forget to set your AndroidManfest.xml's targetSdkVersion to "7" as well.) This will cause any framework calls that don't exist to raise a compiler error.

You also might want to look at the lines above/below the stack trace you received to see if there's any additional information from the verifier indicating why verification failed.

like image 37
Trevor Johns Avatar answered Sep 18 '22 05:09

Trevor Johns