【发布时间】:2017-03-24 19:01:55
【问题描述】:
这是我运行代码时的错误
错误:任务 ':app:transformClassesWithJarMergingForDebug' 执行失败。
com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:android/support/v4/view/LayoutInflaterCompatBase.class
我尝试了很多解决方案,例如使用 ./gradlew clean 清理 gradle、将我的 SDK 更新到最新、排除模块:'support-v4' 等,但问题仍然存在。
这是我的毕业作品
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
apply plugin: 'me.tatarka.retrolambda'
{
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8.toString()
targetCompatibility JavaVersion.VERSION_1_8.toString()
}
testOptions{
unitTests.returnDefaultValues = true;
}
defaultConfig {
applicationId "example.projects"
minSdkVersion 18
targetSdkVersion 23
versionCode 170322001
versionName "0.8.170322001"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
provided "org.projectlombok:lombok:1.12.6"
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.1.6'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.1.1'
compile 'com.code-troopers.betterpickers:library:2.5.1'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services:9.2.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.squareup.picasso:picasso:2.5.2'
compile('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
transitive = true;
}
compile 'com.google.dexmaker:dexmaker:1.2'
compile 'io.realm:android-adapters:1.3.0'
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
}
【问题讨论】:
-
检查以下链接:stackoverflow.com/questions/33676742/… stackoverflow.com/questions/26966843/… 这些可能会有所帮助。