jeudi 1 septembre 2016

Can't solve this: Error:Execution failed for task ':app:transformClassesWithJarMergingForDebugAndroidTest'

Can't solve this:

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebugAndroidTest'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/hamcrest/BaseDescription.class

Orginal Gradle:

buildscript {
    repositories {
        maven { url 'http://ift.tt/1yvwjVF' }
        maven { url 'http://ift.tt/1guwvMz' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'io.fabric'

repositories {
    maven { url 'http://ift.tt/1yvwjVF' }
    maven { url 'http://ift.tt/1guwvMz' }
}


android {
    signingConfigs {
        config {
            keyAlias 'urAndroid'
            keyPassword 'ab123'
            storePassword 'ab'
            storeFile file('../cer/android.jks')
        }
    }
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    lintOptions {
        // but continue the build even when errors are found:
        abortOnError false
    }
    defaultConfig {
        applicationId "com.holandago.ur.ur"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 66
        versionName "2.9.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        debug {
            debuggable true
            testCoverageEnabled = true
        }
        release {
            debuggable false
            signingConfig signingConfigs.config
            ext.betaDistributionEmails = "abr@gmail.com"
            ext.betaDistributionReleaseNotes = "Release Notes for this build."
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'LICENSE.txt'
        exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
        exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
    }
    productFlavors {
    }
}

dependencies {

    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile fileTree(dir: 'libs', include: 'Parse-*.jar')
    compile('com.crashlytics.sdk.android:crashlytics:2.5.6@aar') {
        transitive = true;
    }
    compile 'com.android.support:support-annotations:23.+'
    compile 'com.google.guava:guava:18.0'
    testCompile 'junit:junit:4.12'
    testCompile 'org.robolectric:robolectric:3.0'
    testCompile 'org.mockito:mockito-all:1.10.19'
    testCompile 'org.hamcrest:hamcrest-library:1.3'
    androidTestCompile 'org.hamcrest:hamcrest-core:1.3'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    androidTestCompile 'com.google.code.gson:gson:2.6.1'
    androidTestCompile 'junit:junit:4.12'
    androidTestCompile 'com.android.support:support-annotations:23.+'
    androidTestCompile 'com.android.support.test:runner:0.5'
    androidTestCompile 'com.android.support.test:rules:0.5'
    androidTestCompile 'org.mockito:mockito-all:1.10.19'
    apt 'com.jakewharton:butterknife-compiler:8.0.1'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.android.support:design:23.+'
    compile 'com.android.support:support-v4:23.+'
    compile 'com.android.support:appcompat-v7:23+'
    compile 'com.koushikdutta.ion:ion:1.3.8'
    compile 'com.google.code.gson:gson:2.4'
    compile 'com.pusher:pusher-java-client:0.3.3'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.mixpanel.android:mixpanel-android:4.6.4'
    compile 'com.android.support:recyclerview-v7:23+'
    compile 'com.jakewharton:butterknife:8.0.1'
    androidTestCompile 'com.android.support.test:runner:0.5'
    androidTestCompile 'com.android.support.test:rules:0.5'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.+'
    androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.+'
    androidTestCompile 'com.android.support.test.espresso:espresso-web:2.+'
    compile('com.mapbox.mapboxsdk:mapbox-android-sdk:4.1.0-beta.1@aar') {
        transitive = true
    }
    compile('com.mapbox.mapboxsdk:mapbox-android-services:1.1.0@aar') {
        transitive = true
    }
    // Optional -- Hamcrest library
    androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
}

Tried this Gradle:

buildscript {
    repositories {
        maven { url 'http://ift.tt/1yvwjVF' }
        maven { url 'http://ift.tt/1guwvMz' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'io.fabric'

repositories {
    maven { url 'http://ift.tt/1yvwjVF' }
    maven { url 'http://ift.tt/1guwvMz' }
}


android {
    signingConfigs {
        config {
            keyAlias 'urAndroid'
            keyPassword 'ab123'
            storePassword 'ab'
            storeFile file('../cer/android.jks')
        }
    }
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    lintOptions {
        // but continue the build even when errors are found:
        abortOnError false
    }
    defaultConfig {
        applicationId "com.holandago.ur.ur"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 66
        versionName "2.9.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        debug {
            debuggable true
            testCoverageEnabled = true
        }
        release {
            debuggable false
            signingConfig signingConfigs.config
            ext.betaDistributionEmails = "abr@gmail.com"
            ext.betaDistributionReleaseNotes = "Release Notes for this build."
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'LICENSE.txt'
        exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
        exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
    }
    productFlavors {
    }
}

dependencies {

    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile fileTree(dir: 'libs', include: 'Parse-*.jar')
    compile('com.crashlytics.sdk.android:crashlytics:2.5.6@aar') {
        transitive = true;
    }
    compile 'com.android.support:support-annotations:23.+'
    compile 'com.google.guava:guava:18.0'
    testCompile 'junit:junit:4.12'
    testCompile 'org.robolectric:robolectric:3.0'
    testCompile 'org.mockito:mockito-all:1.10.19'
/*    testCompile 'org.hamcrest:hamcrest-library:1.3'
    androidTestCompile 'org.hamcrest:hamcrest-core:1.3'*/
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    androidTestCompile 'com.google.code.gson:gson:2.6.1'
    androidTestCompile 'junit:junit:4.12'
    androidTestCompile 'com.android.support:support-annotations:23.+'
    androidTestCompile 'com.android.support.test:runner:0.5'
    androidTestCompile 'com.android.support.test:rules:0.5'
    androidTestCompile 'org.mockito:mockito-all:1.10.19'
    apt 'com.jakewharton:butterknife-compiler:8.0.1'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.android.support:design:23.+'
    compile 'com.android.support:support-v4:23.+'
    compile 'com.android.support:appcompat-v7:23+'
    compile 'com.koushikdutta.ion:ion:1.3.8'
    compile 'com.google.code.gson:gson:2.4'
    compile 'com.pusher:pusher-java-client:0.3.3'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.mixpanel.android:mixpanel-android:4.6.4'
    compile 'com.android.support:recyclerview-v7:23+'
    compile 'com.jakewharton:butterknife:8.0.1'
    androidTestCompile 'com.android.support.test:runner:0.5'
    androidTestCompile 'com.android.support.test:rules:0.5'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.+'
    androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.+'
    androidTestCompile 'com.android.support.test.espresso:espresso-web:2.+'
    compile('com.mapbox.mapboxsdk:mapbox-android-sdk:4.1.0-beta.1@aar') {
        transitive = true
    }
    compile('com.mapbox.mapboxsdk:mapbox-android-services:1.1.0@aar') {
        transitive = true
    }
    // Optional -- Hamcrest library
    /*androidTestCompile 'org.hamcrest:hamcrest-library:1.3'*/
}

Aucun commentaire:

Enregistrer un commentaire