在为我的项目构建apk时,我收到以下错误:
Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/simplejavamail/email/AttachmentResource.class
这是我的gradle文件:
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 24
buildToolsVersion '24.0.1'
defaultConfig {
applicationId "com.parassidhu.cdlumaths"
minSdkVersion 16
targetSdkVersion 24
versionCode 2
versionName "1.1"
multiDexEnabled true
}
dexOptions {
incremental true
javaMaxHeapSize "8g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
apt 'com.jakewharton:butterknife-compiler:8.0.1'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton:butterknife:8.0.1'
compile 'com.github.paolorotolo:appintro:3.4.0'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.hotchemi:android-rate:1.0.1'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'org.simplejavamail:simple-java-mail:4.1.1'
compile files('libs/simple-java-mail-4.1.1.jar')
}
apply plugin: 'com.google.gms.google-services'
我想我必须用
'org.simplejavamail:simple-java-mail:4.1.1'
改变一些东西
我不知道出了什么问题。我可以测试应用程序,但当我重建项目/构建apk /生成签名apk时,我收到此错误。有时重复的条目指向与AttachmentResource.class不同的类。