【发布时间】:2017-10-26 09:15:23
【问题描述】:
错误:任务 ':app:transformClassesWithMultidexlistForDebug' 执行失败。
java.io.IOException: 无法写入 [/home/android1/Android/projects/ezeparents/app/build/intermediates/multi-dex/debug/componentClasses.jar] (无法读取 [/home/ android1/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.3.2/31fbbff1ddbf98f3aa7377c94d33b0447c646b6e/httpcore-4.3.2.jar(;;;;;;**.class)] (重复的 zip 条目 [httpcore-4.3.2.jar:org/apache/http/annotation/NotThreadSafe.class]))
build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.ezeparents"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/ECLIPSE_.SF'
exclude 'META-INF/ECLIPSE_.RSA'
exclude 'org/apache/http/annotation/NotThreadSafe.class'
}
}
}
configurations {
all*.exclude group: 'xpp3', module: 'xpp3'
}
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('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
transitive = true;
}
compile 'com.github.nguyenhoanglam:ImagePicker:1.2.1'
compile 'com.roomorama:caldroid:3.0.1'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.github.scottyab:showhidepasswordedittext:0.8'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.android.support:cardview-v7:26.0.1'
compile 'me.relex:circleindicator:1.2.2@aar'
compile 'com.hedgehog.ratingbar:app:1.1.2'
compile 'com.squareup.okhttp3:okhttp:3.8.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.github.fiskurgit:ChipCloud:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.+'
compile 'com.kyleduo.switchbutton:library:1.4.4'
compile 'com.getkeepsafe.taptargetview:taptargetview:1.9.1'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
compile 'com.google.firebase:firebase-messaging:11.4.2'
compile 'com.google.android.gms:play-services-auth:11.4.2'
compile 'com.google.android.gms:play-services-location:11.4.2'
compile 'com.google.android.gms:play-services-places:11.4.2'
compile 'org.igniterealtime.smack:smack-android:4.1.0-rc1'
compile 'org.igniterealtime.smack:smack-tcp:4.1.0-rc1'
compile 'org.igniterealtime.smack:smack-android-extensions:4.1.0-rc1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.googlecode.android-query:android-query:0.24.3'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'uk.co.chrisjenx:calligraphy:2.3.0'
testCompile 'junit:junit:4.12'
compile 'com.github.nguyenhoanglam:ImagePicker:1.2.1'
compile 'com.github.hani-momanii:SuperNova-Emoji:1.1'
compile 'org.apache.commons:commons-lang3:3.5'
compile 'com.android.support:multidex:1.0.2'
}
apply plugin: 'com.google.gms.google-services'
【问题讨论】:
-
需要更多信息。请附上gradle构建文件。
-
我想你对 apache httpcomponens 有问题。尝试清除项目,然后重新运行 gradle sync。也尝试检查这个问题(重复的 zip 条目 [httpcore-4.3.2.jar:org/apache/http/annotation/NotThreadSafe.class])))
-
@MykhailoVoloshyn 今天我将我的 android studio 升级到 3.0,此后我遇到了这个问题。我已经启用了 multiDexEnabled = true 并且还清理了我的项目。运行应用程序而不是同步时仍然面临同样的问题。
-
请在您的 lib 文件夹中附上库名称
-
@AbuQauod 我没有任何 jar 依赖