重复输入:com / google / common / base / FinalizableReference.class

时间:2017-10-29 15:29:54

标签: android google-api android-gradle google-play-services android-multidex

尝试运行项目时遇到错误。

错误:任务':app:transformClassesWithJarMergingForDebug'执行失败。

  

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / google / common / base / FinalizableReference.class

这就是我的build.gradle(Module:app)的样子:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.volleyfragment"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    dexOptions {
        javaMaxHeapSize "4g"

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

repositories {
    mavenCentral()
}

configurations.all() {
    exclude group: "org.apache.httpcomponents", module: "httpclient"
}

dependencies {
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.google.code.findbugs:jsr305:2.0.1'
    compile 'com.android.support:support-v4:26+'
    compile 'com.android.support:appcompat-v7:26+'
    compile 'com.android.support:customtabs:26+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    compile 'com.ss.bottomnavigation:bottomnavigation:1.5.2'
    compile 'com.android.support:recyclerview-v7:26+'
    compile 'com.android.support:cardview-v7:26+'
    compile 'com.android.volley:volley:1.0.0'
    compile files('libs/YouTubeAndroidPlayerApi.jar')
    compile 'com.mikhaellopez:circularimageview:3.0.2'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.google.android.gms:play-services-auth:11.0.0'
    compile 'com.google.android.gms:play-services-plus:11.0.0'
    compile ('com.google.api-client:google-api-client:1.23.0'){
        exclude module: 'support-v4'
        exclude module: 'support-annotations'
    }
    compile 'com.google.oauth-client:google-oauth-client-jetty:1.23.0'
    compile 'com.google.apis:google-api-services-people:v1-rev163-1.23.0'
    compile 'com.android.support:support-v13:26.0.0-alpha1'
}

apply plugin: 'com.google.gms.google-services'

这就是build.gradle项目级别的样子:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

1 个答案:

答案 0 :(得分:0)

升级play-services-plus& compile 'com.google.android.gms:play-services-auth:11.4.2' compile 'com.google.android.gms:play-services-plus:11.4.2' 到11.4.2:

build.gradle

不要忘记在顶级allprojects { repositories { jcenter() maven { url "https://maven.google.com" } } } 添加google maven repo:

from random import randint
class NPC (object):
    def __init__(self,name, phrases):
        self.__name = name
        self.__phrases = #Your code here

    def getDescription(self):
        return self.__description

    def add_phrase(self, phrase):
        #your one line of code here to add a phrase to the phrases an NPC can say

    def getPhrases(self):
        return self.__phrases

    def speak(self):
        #Your code here, no more than 2 lines to select a phrase at random and
        #return it

    def __str__(self):
        return "Good day, I am " + self.__name