错误:任务':packageAllDebugClassesForMultiDex'执行失败

时间:2015-09-10 06:38:55

标签: android gradle android-gradle build.gradle android-multidex

我试图在我的应用程序中实现youtube搜索。我有以下错误

Error:Execution failed for task ':packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: com/google/common/annotations/Beta.class

这是我的gradle文件

dependencies {

    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
    compile 'org.lucasr.twowayview:twowayview:0.1.4'
    compile 'com.google.guava:guava:18.0'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.facebook.android:facebook-android-sdk:4.5.0'
    compile 'com.google.apis:google-api-services-youtube:v3-rev145-1.20.0'
    compile 'com.google.oauth-client:google-oauth-client-jetty:1.20.0'

    compile project(':qsmack322')
    compile project(':viewpagerindicator')
    compile project(':Emojicon')
    compile project(':CircleLoader')

    compile files('libs/acra-4.5.0.jar')
    compile files('libs/android-sqlite-asset-helper.jar')
    compile files('libs/aws-android-sdk-2.1.7-core.jar')
    compile files('libs/aws-android-sdk-2.1.7-s3.jar')
    compile files('libs/commons-io-2.4.jar')
    compile files('libs/daocore.jar')
    compile files('libs/gcmnoti.jar')
    compile files('libs/google-api-client-1.4.1-beta.jar')
    compile files('libs/google-api-client-googleapis-1.4.1-beta.jar')
    compile files('libs/httpmime-4.1.1.jar')
    compile files('libs/jackson-core-asl-1.6.7.jar')
    compile files('libs/newrelic.android.jar')
    compile files('libs/rebound-v0.3.3.jar')
    compile files('libs/twitter4j-core-3.0.5.jar')
    compile files('libs/universal-image-loader-1.9.1-with-sources.jar')

}

请帮助我!!!

2 个答案:

答案 0 :(得分:0)

重复输入,这可能意味着

compile files('libs/google-api-client-1.4.1-beta.jar')
compile files('libs/google-api-client-googleapis-1.4.1-beta.jar')

删除其中一个..

答案 1 :(得分:0)

尝试在您的游戏中添加multiDexEnabled true

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"        
    defaultConfig {
        applicationId "com.your.package"
        minSdkVersion 17
        targetSdkVersion 22
        multiDexEnabled true
    }
}