[英]fixing java.util.zip.ZipException
在我的 Android 項目中,當我運行它時添加了一些庫后,出現了異常。 我的 build.gradle 文件如下。
android {
compileSdkVersion 'Google Inc.:Google APIs:21'
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "com.marpak.livefarmerpro"
minSdkVersion 14
targetSdkVersion 19
versionCode 69
versionName '2.0.15'
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
}
dependencies {
compile project(':holoColorPickermaster')
compile project(':qRCodeReaderViewlib')
compile project(':volley')
compile project(':library')
compile 'com.android.support:support-v4:22.2.1'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:multidex:'
compile 'org.apache.httpcomponents:httpcore:4.4.4'
compile('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: 'httpclient'
}
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
}
當我運行應用程序時,ir 給了我以下錯誤。
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/http/concurrent/BasicFuture.class
我知道這是因為文件重復。 有人可以幫助他解決這個問題。 感謝和問候!
當我有兩個類名相同的類時,我遇到了這個問題。 做./gradlew app:assembleDebug --stacktrace --debug --info
說
java.util.zip.ZipException:重復條目:com/arka/commonlib/model/Charge.class
您可以測試將其放在終端目錄的根目錄中
./gradlew clean
有關更多詳細信息,請訪問: 錯誤:任務 ':app:transformClassesWithJarMergingForDebug' 的執行失敗
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.