1
votes

I am getting VerifyError for method calling of paticular class Utility ,first it was working properly and suddenly its started giving run time error, it is working fine with API lollipop and higher API , Here is my error logs.

06-08 12:25:07.655: E/AndroidRuntime(18117): FATAL EXCEPTION: main
06-08 12:25:07.655: E/AndroidRuntime(18117): java.lang.VerifyError: com/package/projectname/utility/Utility
06-08 12:25:07.655: E/AndroidRuntime(18117):  at com.package.projectname.AppDelegate.onCreate(AppDelegate.java:36)
06-08 12:25:07.655: E/AndroidRuntime(18117):  at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1017)
06-08 12:25:07.655: E/AndroidRuntime(18117):  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4575)
06-08 12:25:07.655: E/AndroidRuntime(18117):  at android.app.ActivityThread.access$1400(ActivityThread.java:153)
06-08 12:25:07.655: E/AndroidRuntime(18117):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1346)
06-08 12:25:07.655: E/AndroidRuntime(18117):  at android.os.Handler.dispatchMessage(Handler.java:99)
06-08 12:25:07.655: E/AndroidRuntime(18117):  at android.os.Looper.loop(Looper.java:176)
06-08 12:25:07.655: E/AndroidRuntime(18117):  at android.app.ActivityThread.main(ActivityThread.java:5302)
06-08 12:25:07.655: E/AndroidRuntime(18117):  at java.lang.reflect.Method.invokeNative(Native Method)
06-08 12:25:07.655: E/AndroidRuntime(18117):  at java.lang.reflect.Method.invoke(Method.java:511)
06-08 12:25:07.655: E/AndroidRuntime(18117):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
06-08 12:25:07.655: E/AndroidRuntime(18117):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
06-08 12:25:07.655: E/AndroidRuntime(18117):  at dalvik.system.NativeStart.main(Native Method)
1
post your Utility class and the method that gives VerifyError - Manish Jain
see if the cases listed here covers your situation. - Akeshwar Jha
@manish jain , for all methods its giving error, like printing log also - Giteeka Sawlani
what is your app buildToolsVersion? - Manish Jain
@manish jain 23 Marhsmallow - Giteeka Sawlani

1 Answers

1
votes

I solved this error by placing gms library separately:

Before I have used :

compile 'com.google.android.gms:play-services:8.1.0'

That above one line will take care of GCM and all google related libaries.But this one line cause a verifier error.On top of the verifier error you can see some gms related log.

After that I have added separately like this to fix this issue :

 compile 'com.google.android.gms:play-services-location:8.1.0'
 compile 'com.google.android.gms:play-services-base:8.1.0'
 compile 'com.google.android.gms:play-services-analytics:8.1.0'
 compile 'com.google.android.gms:play-services-maps:8.1.0'

 compile "com.google.android.gms:play-services-gcm:8.1.0'    // for gcm push notification

and also Check this