Jar合并调试与android重复输入? [英] Jar merging for debug throwing duplicate entry with android?

查看:203
本文介绍了Jar合并调试与android重复输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 错误:执行失败的任务':app:transformClassesWithJarMergingForDebug' > com.android.build.transform.api.TransformException:java.util.zip.ZipException:duplicate entry:android / support / annotation / AnimatorRes.class 

这是我的build.gradle

 依赖项{
编译fileTree dir:'libs',include:['* .jar'])
testCompile'junit:junit:4.12'
compile'c​​om.android.support:appcompat-v7:23.1.0'
compile'c​​om.android.support:design:23.1.0'
compile('com.digits.sdk.android:digits:1.9.0@aar'){
transitive = true;
}
compile'c​​om.parse.bolts:bolt-android:1. +'
compile'c​​om.parse:parse-android:1. +'
compile'c​​om .android.support:cardview-v7:23.1.0'
compile'me.zhanghai.android.materialprogressbar:library:1.0.2'
compile'c​​om.android.support:support-v4:23.1 .0'
编译'com.google.android.gms:play-services-identity:8.1.0'
compile'c​​om.google.android.gms:play-services-plus:8.1.0 '
compile'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile'c​​om.anjlab.android .iab.v3:library:1.0。+ @ aar'
}

这是一个我的图书馆的图片





我希望有人在这里可以帮我找出什么问题是。我使用android studio。

解决方案

尝试排除 support-v4 ,因为 google-play-services 已经包含 support-v4

  compile('com.google.android.gms:play-services:8.1.0')
{
exclude group :'com.android.support',module:'support-v4'
}

如果不行,
清理项目并重建它。



否则,尝试设置

  defaultConfig {
multiDexEnabled true
}


Im getting this error when trying to run my build:

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

Here is my build.gradle

dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.1.0'
        compile 'com.android.support:design:23.1.0'
        compile('com.digits.sdk.android:digits:1.9.0@aar') {
            transitive = true;
        }
        compile 'com.parse.bolts:bolts-android:1.+'
        compile 'com.parse:parse-android:1.+'
        compile 'com.android.support:cardview-v7:23.1.0'
        compile 'me.zhanghai.android.materialprogressbar:library:1.0.2'
        compile 'com.android.support:support-v4:23.1.0'
        compile 'com.google.android.gms:play-services-identity:8.1.0'
        compile 'com.google.android.gms:play-services-plus:8.1.0'
        compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
        compile 'com.anjlab.android.iab.v3:library:1.0.+@aar'
    }

Here is a pic of my libs

Im hoping someone here can help me find out what the issue is. Im using android studio.

解决方案

Try excluding the support-v4 since the google-play-services already contains the support-v4

compile ('com.google.android.gms:play-services:8.1.0')
{
     exclude group: 'com.android.support', module: 'support-v4'
}

if it doesn't work, Clean the project and rebuild it.

Else, try setting multiDexEnabled in the gradle file

defaultConfig {
    multiDexEnabled true
}

这篇关于Jar合并调试与android重复输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆