如何纠正GMS未捕获的异常.NoClassDefFoundError:com.google.android.gms.internal.zzno

时间:2015-11-20 15:48:44

标签: android sdk google-play-services

我的应用程序的OS 4.x版本中止没有找到类.NoClassDefFoundError:com.google.android.gms.internal.zzno。当手机使用更高版本的Google Play服务时,似乎不会出现问题。您如何解决此构建问题。这是日志。

  

11-20 10:03:25.945 3018-3018 / com.something.foobar D / dalvikvm:延迟启用CheckJNI   11-20 10:03:26.089 3018-3018 / com.something.foobar W / dalvikvm:VFY:无法找到签名中引用的类(Lcom / google / android / gms / internal / zznl;)   11-20 10:03:26.089 3018-3018 / com.something.foobar W / dalvikvm:VFY:无法找到签名中引用的类(Lcom / google / android / gms / internal / zznl;)   11-20 10:03:26.089 3018-3018 / com.something.foobar I / dalvikvm:找不到方法com.google.android.gms.internal.zznl.currentTimeMillis,从com.google.android.gms方法引用。 measurement.internal.zzt.zzBM   11-20 10:03:26.089 3018-3018 / com.something.foobar W / dalvikvm:VFY:无法解析接口方法44251:Lcom / google / android / gms / internal / zznl; .currentTimeMillis()J   11-20 10:03:26.089 3018-3018 / com.something.foobar D / dalvikvm:VFY:在0x007f处替换操作码0x72   11-20 10:03:26.137 3018-3018 / com.something.foobar D / dalvikvm:VFY:将代码0x71替换为0x0000   11-20 10:03:26.137 3018-3018 / com.something.foobar D / AndroidRuntime:关闭VM   11-20 10:03:26.137 3018-3018 / com.something.foobar W / dalvikvm:threadid = 1:线程退出未捕获的异常(组= 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                                                                          在com.google.android.gms.measurement.internal.zzx.zzj(未知来源)                                                                          在com.google.android.gms.measurement.internal.zzt。(未知来源)                                                                          在com.google.android.gms.measurement.internal.zzx.zzBQ(未知来源)                                                                          在com.google.android.gms.measurement.internal.zzt.zzaU(未知来源)                                                                          在com.google.android.gms.measurement.AppMeasurementContentProvider.onCreate(未知来源)                                                                          在android.content.ContentProvider.attachInfo(ContentProvider.java:1214)                                                                          在android.content.ContentProvider.attachInfo(ContentProvider.java:1189)                                                                          在android.app.ActivityThread.installProvider(ActivityThread.java:4879)                                                                          在android.app.ActivityThread.installContentProviders(ActivityThread.java:4485)                                                                          在android.app.ActivityThread.handleBindApplication(ActivityThread.java:4425)                                                                          在android.app.ActivityThread.access $ 1300(ActivityThread.java:141)                                                                          在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1316)                                                                          在android.os.Handler.dispatchMessage(Handler.java:99)                                                                          在android.os.Looper.loop(Looper.java:137)                                                                          在android.app.ActivityThread.main(ActivityThread.java:5103)                                                                          at java.lang.reflect.Method.invokeNative(Native Method)                                                                          在java.lang.reflect.Method.invoke(Method.java:525)                                                                          在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:737)                                                                          在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 /处理:发送信号。 PID:3018 SIG:9

我尝试使用compileSdkVersion / targetSdkVersion 22和23,但是出现了大量的样式主题错误。

这是gradle构建

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;
}

1 个答案:

答案 0 :(得分:6)

我能够通过在我的应用程序类中添加它来解决同样的问题

public class MyApp extends Application {


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

}