【发布时间】:2017-09-06 03:07:50
【问题描述】:
我是 Android 编程新手,请帮助我。
我在编译我的应用程序时遇到了这样的错误:
错误:任务 ':app:transformClassesWithJarMergingForDebug' 执行失败。
com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:android/support/v4/view/ViewPager$MyAccessibilityDelegate.class
这是我的 gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.ecs.google.maps.v2.actionbarsherlock"
minSdkVersion 9
targetSdkVersion 17
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
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'
}
}
configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }
dependencies {
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile ('com.android.support:gridlayout-v7:+') {
exclude module: 'support-v4'
}
compile 'com.astuetz:pagerslidingtabstrip:1.0.0'
compile ('com.google.maps.android:android-maps-utils:0.3+') {
exclude module: 'support-v4'
}
compile 'com.google.code.gson:gson:2.1'
compile ('com.google.android.gms:play-services-maps:8.4.0') {
exclude module: 'support-v4'
}
compile files('libs/google-http-client-1.15.0-rc.jar')
compile files('libs/google-http-client-android-1.15.0-rc.jar')
compile files('libs/google-http-client-jackson2-1.15.0-rc.jar')
compile files('libs/httpclient-4.0.1.jar')
compile files('libs/httpcore-4.0.1.jar')
compile files('libs/jackson-core-2.1.3.jar')
compile files('libs/jackson-core-asl-1.9.11.jar')
}
我已经删除了我的 lib 文件夹中所有重复的 support-v4 文件。
您能说出我的代码有什么问题吗?感谢您的帮助。
【问题讨论】:
标签: android duplicates