android - 我收到 gradle 错误任务执行失败

标签 android compiler-errors android-gradle-plugin

我收到这个错误

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

我附上了我的 gradle 请检查并帮助我。

    android {
              useLibrary 'org.apache.http.legacy'
             }

       dependencies {

    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile files('libs/android-async-http-1.4.4.jar')
    compile files('libs/disklrucache-2.0.1.jar')
    compile files('libs/google-gson.jar')
    compile project(':linkedin-sdk')
    compile files('libs/PGSDK_V2.0.jar')
    compile 'com.android.support:support-v13:25.3.1'
    compile files('libs/okhttp-1.2.1-jar-with-dependencies.jar')
    compile files('libs/volley.jar')
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'uk.co.chrisjenx:calligraphy:2.2.0'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:support-v4:25.3.1'
    testCompile 'junit:junit:4.12'
    compile 'com.razorpay:checkout:1.4.1'
    compile 'com.google.android.gms:play-services-auth:9.2.1'

    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.jjoe64:graphview:4.2.0'


}

最佳答案

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

移除

 compile files('libs/volley.jar') // From local lib also

使用

compile 'com.android.volley:volley:1.0.0'

I am using linkedin sdk,inside linkedin adk also one volley compile is there and my app level I have one more volley dependency.

你应该在那里调用 volley:1.0.0

关于android - 我收到 gradle 错误任务执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47362934/

相关文章:

android-studio - Android Studio - FindBugs excludeFilter 文件适用于 IDEA 插件,但不适用于 Gradle 插件

Android 可扩展 ListView : set background color of selected item on click

function - 数组被错误地称为子或函数

c++ - 在堆上实例化一个对象

java - Java 10 上的 Swing 问题

android - FindBugs 插件不工作

Android Gradle 无法构建也无法解析 R

android - 在android中动态添加按钮到布局

android - 获取 ListItem ContextMenu 中的选定项目

android - Jest 是一个 React Native 单元测试工具吗?