Android - 无法运行,gradle错误,重复输入

时间:2017-03-24 10:25:54

标签: java android gradle

当我运行我的代码时,这是我的错误

错误:任务':app:transformClassesWithJarMergingForDebug'执行失败。

  

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:android / support / v4 / view / LayoutInflaterCompatBase.class

我尝试了许多解决方案,例如使用./gradlew清理gradle,将我的SDK更新到最新的,排除模块:' support-v4'等,问题仍然存在

这是我的gradle

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'
}

1 个答案:

答案 0 :(得分:0)

我认为这两行存在问题

compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services:9.2.0'

请更改任何一个版本。喜欢

 compile 'com.google.android.gms:play-services:9.0.0'