Java.Lang.Noclassdeffounderror: Com.Google.Android.Gms.Internal.Zzmp

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

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."

java.lang.NoClassDefFoundError: com.google.android.gms.common.internal.zzd

After some research and hours of testing I finally realized that android has something called the DEX 64K Methods Limit. In simple words there's a limit you can reach when adding external libraries to your project. When you reaches that limit you might need to use multidex. Personally I decided to reduce the amount of libraries imported as some of them weren't really used or necesary.
For further understanding of multidex you should read this,

http://developer.android.com/tools/building/multidex.html

java.lang.NoClassDefFoundError: com.google.android.gms.R$string at com.google.android.gms.common.internal.zzam.init(Unknown Source)

The solution was simply adding the following code in my class that extended Application:

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

The solution was at java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzmp, so this question could be marked as duplicate.

google GCM android crashes ( java.lang.NoClassDefFoundError: com.google.android.gms.R$string )

I had same problem.You are probably facing it on devices prior 5.0 version.The reason why this happen is that version prior to android 5.0 use Dalvik and by default, Dalvik limits apps to a single classes.dex bytecode file per APK.The solution is to use multidex support.

Include in your build.gradle dependencies this:

compile 'com.android.support:multidex:1.0.0'

public class MyApp extends MultiDexApplication {

@Override
public void onCreate() {
super.onCreate();
}

}

than in your Manifest add MultiDexApplication class

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.multidex.myapplication">
<application
...
android:name=".MyApp">
...
</application>
</manifest>

Note: If you already have your application class just extend it with MultiDexApplication class



Related Topics



Leave a reply



Submit