在APK AUTHORS中复制的重复文件

时间:2016-12-13 13:03:49

标签: java android apk

当我要编译项目时,我遇到了这个问题: 当我将我的项目构建到APK时,我有这个错误:

错误:任务':app:transformClassesWithJarMergingForDebug'执行失败。

  

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:org / objectweb / asm / tree / AbstractInsnNode.class

这是我的傻瓜。

apply plugin: 'com.android.application' buildscript { repositories { mavenCentral() maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'io.fabric.tools:gradle:1.+' } } repositories { mavenCentral() maven { url 'https://maven.fabric.io/public' } } android { compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { applicationId "come.texi.driver" minSdkVersion 16 targetSdkVersion 23 versionCode 2 versionName "2.0" multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } dexOptions { preDexLibraries = false javaMaxHeapSize "4g" } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) // compile 'com.jakewharton:butterknife:7.0.1' //compile 'com.loopj.android:android-async-http:1.4.9' compile project(':facebooklibrary') compile project(':slideMenuLibrary') compile project(':stripe') compile('com.twitter.sdk.android:twitter:1.13.0@aar') { transitive = true } //compile 'com.github.nkzawa:socket.io-client:0.3.0' compile('io.socket:socket.io-client:0.7.0') { // excluding org.json which is provided by Android exclude group: 'org.json', module: 'json' } //compile 'com.paypal.sdk:paypal-android-sdk:2.14.4' compile('com.paypal.sdk:paypal-android-sdk:2.14.4') { exclude group: 'org.json', module: 'json' } compile 'com.android.support:appcompat-v7:25.0.1' compile 'com.android.support:design:25.0.1' compile 'cz.msebera.android:httpclient:4.4.1.1' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.koushikdutta.ion:ion:2.+' compile 'com.victor:lib:1.0.1' compile 'com.facebook.android:facebook-android-sdk:4.7.0' compile 'com.google.android.gms:play-services-maps:9.4.0' compile 'com.google.android.gms:play-services-analytics:9.4.0' compile 'com.google.android.gms:play-services-gcm:9.4.0' compile 'com.android.support:multidex:1.0.1' compile 'com.android.tools.build:gradle:2.2.3' testCompile 'junit:junit:4.12' }

帮帮我!!

1 个答案:

答案 0 :(得分:0)

我有完全相同的问题,除了我使用Android Gradle Plugin 2.3.3,但这不是问题。这是我如何解决它,希望这会对你有所帮助。

在Android内部,添加packagingOptions以排除AUTHORS,如下所示:

android {
   packagingOptions {
      exclude 'AUTHORS'
   }
}

以下是documentation reference