Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzmp

Tags:

android

Receiving this error on Android 4.4 device when starting my app. App immediately crashes. However I don't have this error on Android 5.1 device. Any clue?

10-15 22:35:06.306 14072-14072/com D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x0000 10-15 22:35:06.306 14072-14072/com D/AndroidRuntime﹕ Shutting down VM 10-15 22:35:06.306 14072-14072/com W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x4304b160) 10-15 22:35:06.306 14072-14072/com E/AndroidRuntime﹕ FATAL EXCEPTION: main Process:com., PID: 14072 java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzmp at com.google.android.gms.measurement.internal.zzz.zzj(Unknown Source) at com.google.android.gms.measurement.internal.zzv.(Unknown Source) at com.google.android.gms.measurement.internal.zzz.zzAq(Unknown Source) at com.google.android.gms.measurement.internal.zzv.zzaL(Unknown Source) at com.google.android.gms.measurement.AppMeasurementContentProvider.onCreate(Unknown Source) at android.content.ContentProvider.attachInfo(ContentProvider.java:1591) at android.content.ContentProvider.attachInfo(ContentProvider.java:1562) at android.app.ActivityThread.installProvider(ActivityThread.java:4830) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4425) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4365) at android.app.ActivityThread.access$1500(ActivityThread.java:138) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1296) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:149) at android.app.ActivityThread.main(ActivityThread.java:5061) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:603) at dalvik.system.NativeStart.main(Native Method)

like image 928
MobileMon Avatar asked Oct 16 '15 02:10

MobileMon


2 Answers

needed to add this in class that extends Application:

 @Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
}

EDIT: I noticed this answer is becoming more popular so please note my comment on the question:

"ATTENTION To anybody reading this though! The real problem was that I was using the ENTIRE google play services framework which was forcing me into multi dex. Avoid multi dex if you can because it slows down builds. Only bring in what you need from google play services. So instead of putting "compile 'com.google.android.gms:play-services:8.1.0'", put "compile 'com.google.android.gms:play-services-location:8.1.0'" for example."

like image 131
MobileMon Avatar answered Nov 02 '22 21:11

MobileMon


For those who have already activated MultiDex and still get this exception, it's just a stupid Android Studio / Gradle issue.

Try cleaning project, toggling Instant Run in settings, and rebuilding the project.

like image 24
Iman Akbari Avatar answered Nov 02 '22 19:11

Iman Akbari