android - 错误重复条目 : com/google/android/gms/location/places/zzj. 类

标签 android android-studio google-play-services google-places-api

当我尝试运行我的项目时出现此错误:

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/location/places/zzj.class

这是我正在使用的 build.gradle 文件:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'
        classpath 'io.realm:realm-gradle-plugin:0.89.1'
    }
}
apply plugin: "com.android.library"
apply plugin: "realm-android"

repositories {
    jcenter()
}

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 22
    }

    buildTypes {
        debug {
            minifyEnabled false
        }
        release {
            minifyEnabled false
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile "com.android.support:appcompat-v7:23.1.1"
    compile "com.android.support:cardview-v7:23.1.1"
    compile "com.android.support:recyclerview-v7:23.1.1"
    compile "com.android.support:design:23.1.1"
    compile "com.squareup.okhttp3:okhttp:3.1.2"
    compile ('com.facebook.android:facebook-android-sdk:4.9.0')
        { exclude group: 'com.android.support' }
    compile ('com.googlecode.libphonenumber:libphonenumber:7.2.2')
        { exclude group: 'com.android.support' }
    compile "com.pubnub:pubnub-android:3.7.6"
    compile "com.google.android.gms:play-services-maps:9.0.0"
    compile "com.google.android.gms:play-services-gcm:9.0.0"
    compile "com.google.android.gms:play-services-location:9.0.0"
    compile ('com.appyvet:materialrangebar:1.3')
        { exclude group: 'com.android.support' }
    compile 'com.google.code.gson:gson:2.5'
    compile "com.amazonaws:aws-android-sdk-s3:2.2.10"
    compile "com.amazonaws:aws-android-sdk-core:2.2.10"
    compile ('com.instabug.library:instabug:2.1')
        { exclude group: 'com.android.support' }
    compile 'com.github.tony19:logback-android-core:1.1.1-4'
    compile 'com.github.tony19:logback-android-classic:1.1.1-4'
    compile 'org.slf4j:slf4j-api:1.7.6'
    compile 'ch.acra:acra:4.8.2'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.15'
    compile 'org.greenrobot:eventbus:3.0.0'
    compile 'com.android.support:multidex:1.0.0'
}

最佳答案

我已将 google play 服务( map 、位置和 gcm)从 9.0.0 升级到 9.2.0

compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-maps:9.2.0'
compile 'com.google.android.gms:play-services-gcm:9.2.0'

然后我添加了这个依赖:

compile 'com.google.android.gms:play-services-places:9.2.0'

它就像一个魅力:)

关于android - 错误重复条目 : com/google/android/gms/location/places/zzj. 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38111388/

相关文章:

android - 在 Android 中录制电话

android - 如何配置 Androids sdkmanager 命令行工具以使用自定义存储库?

java - 自动完成文本并在 map 上搜索

android - Gradle 找不到 google play 依赖项

c# - Xamarin FindViewById 返回 null

android - 如何使用 phonegap-plugin-push 获取 GCM ID

android - 使用默认的android图像查看器显示图片

android - 如何在android studio中用gradle替换buildvariant的字符串?

java - Google Play 游戏服务在添加所有内容时不断崩溃

android - 如何使用 gradle 在 IntelliJ IDEA 13 中添加 google play 服务