Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 错误:任务“”的执行失败:应用程序:PackageAllDebugClassesForMultiIndex'_Android_Gradle_Android Youtube Api_Android Multidex - Fatal编程技术网

Android 错误:任务“”的执行失败:应用程序:PackageAllDebugClassesForMultiIndex'

Android 错误:任务“”的执行失败:应用程序:PackageAllDebugClassesForMultiIndex',android,gradle,android-youtube-api,android-multidex,Android,Gradle,Android Youtube Api,Android Multidex,当我尝试使用YouTubeData API构建应用程序时,出现“:app:packageAllDebugClassesForMultiIndex”错误。我研究了其他几个涉及此错误的线程,得出的结论是,我的构建文件中有一些库正在创建对构建文件的重复引用。我知道触发错误的文件是: 'com/google/api/client/googleapis/json/GoogleJsonErrorContainer.class' 但是如何在不删除整个库的情况下从生成文件中排除引用呢 这是我的构建文件 appl

当我尝试使用YouTubeData API构建应用程序时,出现“:app:packageAllDebugClassesForMultiIndex”错误。我研究了其他几个涉及此错误的线程,得出的结论是,我的构建文件中有一些库正在创建对构建文件的重复引用。我知道触发错误的文件是:

'com/google/api/client/googleapis/json/GoogleJsonErrorContainer.class'

但是如何在不删除整个库的情况下从生成文件中排除引用呢

这是我的构建文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "co.hannalupi.fitnessblenderapp"
        minSdkVersion 16
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile files('libs/YouTubeAndroidPlayerApi.jar')
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.google.apis:google-api-services-youtube:v3-rev136-1.20.0'

}
这是我得到的错误:

    FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: com/google/api/client/googleapis/json/GoogleJsonErrorContainer.class

我是Android新手,您能为我指出的任何方向都将不胜感激。提前感谢。

针对有类似错误的人的更新-作为最后手段,我从桌面上删除了正在处理的项目文件,并从GitHub克隆了一个新副本。导入并运行新副本没有给我任何错误