android - 错误 :Execution failed for task ':app:transformClassesWithJarMergingForDebug'

标签 android compiler-errors

美好的一天。 在 AndroidStudio 中更新 google 存储库后,我有一个问题

> Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.transform.api.TransformException: java.util.zip.ZipException: duplicate entry:
> android/support/v7/cardview/BuildConfig.class

我试图从播放服务中排除组 android.support,它没有帮助。 当我在另一台 PC 上开始我的项目时,我有:

> Error:Execution failed for task  ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.transform.api.TransformException: java.util.zip.ZipException: duplicate entry:
> android/support/annotation/AnimRes.class

我的 build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'com.android.databinding'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "ru.alexeyk.myevents"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 16
        versionName "1.121"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile('com.github.nkzawa:socket.io-client:0.4.2') {
        exclude group: 'org.json', module: 'json'
    }
    compile files('libs/sentry-1.1.4.jar')
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:support-annotations:23.1.0'
    compile 'com.android.support:design:23.1.0'
    compile 'com.android.support:support-v4:23.1.0'
    compile 'com.android.support:cardview-v7:23.1.0'
    compile 'com.android.support:recyclerview-v7:23.1.0'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
    compile 'com.github.machinarius:preferencefragment:0.1.2'
    compile 'com.edmodo:cropper:1.0.1'
    compile 'com.makeramen:roundedimageview:2.1.1'
    compile 'org.ocpsoft.prettytime:prettytime:4.0.0.Final'
    compile 'com.yandex.android:mobmetricalib:2.00@aar'
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'com.google.android.gms:play-services-ads:8.1.0'
    compile 'com.google.android.gms:play-services-analytics:8.1.0'
    compile 'com.google.android.gms:play-services-identity:8.1.0'
    compile 'com.google.android.gms:play-services-gcm:8.1.0'
}

最佳答案

在终端中执行根项目文件夹:

./gradlew clean

它帮助了我。

关于android - 错误 :Execution failed for task ':app:transformClassesWithJarMergingForDebug' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33209631/

相关文章:

android - 什么是猴子服务器?

android - 如何在没有鹅卵石 watch 的情况下测试应用程序?

android - Google play 如何知道应用安装所在的国家/地区?

java - 尽管我使用了 Integer.parseInt,但出现了不兼容的类型错误

c++ - 解决由于类之间的循环依赖而导致的构建错误

c - 在 C 中转换指针时出错

c++ - VS 2012 Ultimate update 4 不会编译数组

android - 识别在 ListActivity 方法 onListItemClick 上点击的项目

java - 如何为应用程序在后台显示的那些通知设置自定义布局?

c++ - 错误 - 不能重载仅返回类型不同的函数。 C++