0

This is my error when i run my code

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/view/LayoutInflaterCompatBase.class

I've tried many solution such as cleaning the gradle with ./gradlew clean, updating my SDK to the newest, exclude module: 'support-v4', etc. and the problem still remains.

Here are my 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'
}
  • Please read this docs. https://developers.google.com/android/guides/setup – Rabindra Acharya Mar 24 '17 at 10:29
  • Check following links: http://stackoverflow.com/questions/33676742/java-util-zip-zipexception-duplicate-entry-android-support-v4-view-motionevent http://stackoverflow.com/questions/26966843/java-util-zip-zipexception-duplicate-entry-during-packagealldebugclassesformult These might help. – Sonam Mar 24 '17 at 10:52

1 Answers1

0

I think problem in this two lines

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

Please change the version of any one. like

 compile 'com.google.android.gms:play-services:9.0.0'
Rajkumar Kumawat
  • 290
  • 2
  • 11
  • it gives me warning "All com.google.android.gms must use same exact version" but it compilable. After i compiled it, the error now is Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzsj$zza.class – Neville Okky Mar 29 '17 at 04:14