Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to correct GMS uncaught exception .NoClassDefFoundError: com.google.android.gms.internal.zzno

OS 4.x versions of my app abort not finding class .NoClassDefFoundError: com.google.android.gms.internal.zzno. There doesn't seem to be an issue when the phone uses the later versions of Google Play Services. How do you resolve this build issue. Here's the log.

11-20 10:03:25.945 3018-3018/com.something.foobar D/dalvikvm: Late-enabling CheckJNI 11-20 10:03:26.089 3018-3018/com.something.foobar W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/google/android/gms/internal/zznl;) 11-20 10:03:26.089 3018-3018/com.something.foobar W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/google/android/gms/internal/zznl;) 11-20 10:03:26.089 3018-3018/com.something.foobar I/dalvikvm: Could not find method com.google.android.gms.internal.zznl.currentTimeMillis, referenced from method com.google.android.gms.measurement.internal.zzt.zzBM 11-20 10:03:26.089 3018-3018/com.something.foobar W/dalvikvm: VFY: unable to resolve interface method 44251: Lcom/google/android/gms/internal/zznl;.currentTimeMillis ()J 11-20 10:03:26.089 3018-3018/com.something.foobar D/dalvikvm: VFY: replacing opcode 0x72 at 0x007f 11-20 10:03:26.137 3018-3018/com.something.foobar D/dalvikvm: VFY: replacing opcode 0x71 at 0x0000 11-20 10:03:26.137 3018-3018/com.something.foobar D/AndroidRuntime: Shutting down VM 11-20 10:03:26.137 3018-3018/com.something.foobar W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xa4b6c648) 11-20 10:03:26.141 3018-3018/com.something.foobar E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzno at com.google.android.gms.measurement.internal.zzx.zzj(Unknown Source) at com.google.android.gms.measurement.internal.zzt.(Unknown Source) at com.google.android.gms.measurement.internal.zzx.zzBQ(Unknown Source) at com.google.android.gms.measurement.internal.zzt.zzaU(Unknown Source) at com.google.android.gms.measurement.AppMeasurementContentProvider.onCreate(Unknown Source) at android.content.ContentProvider.attachInfo(ContentProvider.java:1214) at android.content.ContentProvider.attachInfo(ContentProvider.java:1189) at android.app.ActivityThread.installProvider(ActivityThread.java:4879) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4485) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4425) at android.app.ActivityThread.access$1300(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5103) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method) 11-20 10:03:28.753 3018-3018/? I/Process: Sending signal. PID: 3018 SIG: 9

I tried going to compileSdkVersion / targetSdkVersion 22 and 23, but got a plethora of style theme errors.

Here is the gradle build

buildscript {
repositories {
    mavenCentral()
    maven { url "https://plugins.gradle.org/m2/" }
    maven { url 'https://maven.fabric.io/public' }
}
dependencies {
    classpath "org.codehaus.groovy:gradle-groovy-android-plugin:0.3.5"
    classpath 'io.fabric.tools:gradle:1.+'
}
}

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
maven { url 'https://maven.fabric.io/public' }
}


android {
signingConfigs {
    ...

}
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId 'com.something.foobar'
    minSdkVersion 16
    targetSdkVersion 21
    versionCode 1402
    versionName "1.4.02"
    multiDexEnabled = true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
packagingOptions {
    exclude 'META-INF/ASL2.0'
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'
}
productFlavors {
    developercode {
        minSdkVersion 16
        applicationId 'com.something.foobar'

        targetSdkVersion 21
        versionCode 1402
        versionName '1.4.02'
    }
    eridesharecode {
        minSdkVersion 16
        applicationId 'com.something.foobar'
        targetSdkVersion 21
        versionCode 1402
        versionName '1.4.02'
    }
}
dexOptions { javaMaxHeapSize "2g" }
compileOptions {
    encoding "UTF-8"
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':library')
compile 'com.android.support:support-v4:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
compile 'com.squareup.okio:okio:1.1.0'
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.joanzapata.android:android-iconify:1.0.6'
compile 'com.tundem.aboutlibraries:library:4.0.1@aar'
compile 'com.squareup.retrofit:retrofit:1.9.0'
provided 'com.squareup.dagger:dagger:1.2.+'
compile 'com.google.android.gms:play-services:+'
compile 'cn.pedant.sweetalert:library:1.3'
compile 'de.greenrobot:eventbus:2.1.0'
compile files('libs/nineoldandroids-2.4.0.jar')
provided 'com.squareup.dagger:dagger-compiler:1.2.+'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.joanzapata.mapper:simple-mapper:1.0.10'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.google.maps.android:android-maps-utils:0.3+'
compile 'javax.mail:mail:1.4.7'
compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
    transitive = true;
}
like image 424
Peter Birdsall Avatar asked Nov 20 '15 15:11

Peter Birdsall


1 Answers

I was able to fix the same problem by adding this in my Application Class

public class MyApp extends Application {


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

}
like image 129
Sam Bellerose Avatar answered Oct 06 '22 00:10

Sam Bellerose