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

查看:33
本文介绍了java.lang.NoClassDefFoundError: com.google.android.gms.common.internal.zzd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Maps api v2,它与 4.4、5.0、5.1、5.1.1、6 完美配合,但当我尝试 4.2.2 时应用程序崩溃.我一直在做很多研究,但似乎没有任何效果.这是完整的日志.

Using Maps api v2 and it works perfectly with 4.4 , 5.0, 5.1, 5.1.1 , 6 but app crashes when I try 4.2.2. I've been doing lots of research but nothing seems to work. Here's the complete log.

FATAL EXCEPTION: main
     java.lang.NoClassDefFoundError: com.google.android.gms.common.
         at com.google.android.gms.measurement.internal.zzk$zza.get(
         at com.google.android.gms.measurement.internal.zzc.zzkG(
         at com.google.android.gms.measurement.internal.zzr.<init>(
         at com.google.android.gms.measurement.internal.zzx.zzb(
         at com.google.android.gms.measurement.internal.zzt.<init>(
         at com.google.android.gms.measurement.internal.zzx.zzBQ(
         at com.google.android.gms.measurement.internal.zzt.zzaU(
         at com.google.android.gms.measurement.ource)
         at android.content.ContentProvider.attachInfo(ContentProvider
         at android.app.ActivityThread.installProvider(ActivityThread.
         at android.app.ActivityThread.installContentProviders(
         at android.app.ActivityThread.handleBindApplication(
         at android.app.ActivityThread.access$1300(ActivityThread.
         at android.app.ActivityThread$H.handleMessage(ActivityThread.
         at android.os.Handler.dispatchMessage(Handler.java:99)
         at android.os.Looper.loop(Looper.java:137)
         at android.app.ActivityThread.main(ActivityThread.java:5041)
         at java.lang.reflect.Method.invokeNative(Native Method)
         at java.lang.reflect.Method.invoke(Method.java:511)
         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
         at com.android.internal.os.ZygoteInit.main(ZygoteInit.
         at dalvik.system.NativeStart.main(Native Method)

有什么想法吗?

这是我的 build.gradle

Here´s my build.gradle

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

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    mavenCentral()
    maven {
        url "http://dl.bintray.com/glomadrian/maven"
    }
    maven { url 'https://maven.fabric.io/public' }
}

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "py.com.roshka.billeterabancard"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.wang.avi:library:1.0.1'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.github.glomadrian:loadingballs:1.1@aar'
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.android.support:design:23.1.0'
    compile 'com.android.support:recyclerview-v7:23.1.0'
    compile 'com.squareup.okio:okio:1.0.+'
    compile 'com.squareup.okhttp:okhttp:1.5.4'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
    compile 'com.squareup.retrofit:retrofit:1.8.0'
    compile 'com.pnikosis:materialish-progress:1.7'
    compile 'com.google.code.gson:gson:2.3'
    compile 'me.dm7.barcodescanner:zxing:1.8.3'
    compile 'me.dm7.barcodescanner:zbar:1.8.3'
    compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
        transitive = true;
    }
}

推荐答案

经过一些研究和数小时的测试后,我终于意识到 android 有一个叫做 DEX 64K 方法限制的东西.简而言之,在向项目中添加外部库时,您可以达到一个限制.当您达到该限制时,您可能需要使用 multidex.我个人决定减少导入的库数量,因为其中一些不是真正使用或不需要的.为了进一步了解 multidex,您应该阅读此内容,

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.common.internal.zzd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆