mardi 26 juillet 2016

unable to run tests in android because of some junit conflict

I am getting this an error when i try to run my test case Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lorg/hamcrest/MatcherAssert;

my build.gradle is as follows

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId "my app name"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 3
        versionName "1.2"
    }
    lintOptions {
        abortOnError false
    }
    signingConfigs {
        release {
            storeFile file(RELEASE_STORE_FILE)
            storePassword RELEASE_STORE_PASSWORD
            keyAlias RELEASE_KEY_ALIAS
            keyPassword RELEASE_KEY_PASSWORD
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }
        debug {
            testCoverageEnabled = true
        }
    }
}

repositories {
    jcenter()
    maven { url "https://jitpack.io" }
}

dependencies {
    compile 'com.android.support:design:23.2.1'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.android.support:cardview-v7:23.2.1'
    compile 'com.github.bumptech.glide:glide:3.6.0'
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile project(':library')
    compile 'com.squareup.retrofit2:retrofit:2.0.0'
    compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
    compile 'com.android.support:recyclerview-v7:23.2.1'
    compile 'co.dift.ui.swipetoaction:library:1.1'
    compile 'jp.wasabeef:recyclerview-animators:2.2.0'
    compile 'com.google.android.gms:play-services-analytics:8.4.0'
    compile 'com.scottyab:aescrypt:0.0.1'
    compile 'com.kyleduo.switchbutton:library:1.4.1'
    compile 'com.github.PhilJay:MPAndroidChart:v2.2.5'
    compile 'com.squareup:otto:1.3.8'

    testCompile 'junit:junit:4.12'
    testCompile 'org.robolectric:robolectric:3.0'
    testCompile 'org.robolectric:shadows-support-v4:3.0'
    compile 'com.android.support:support-annotations:23.2.1'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.0'
    androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
    compile 'com.squareup.okhttp3:okhttp:3.4.1'
    androidTestCompile 'com.squareup.okhttp3:mockwebserver:3.4.1'
}

apply plugin: 'com.google.gms.google-services'

Aucun commentaire:

Enregistrer un commentaire