Android Studio 3.0 DexArchiveBuilderException

I'm having this error whilst compiling Instrumentation tests. Failed to process /Users/rafaelruizmunoz/SourceTree/Weather/app/build/intermediates/transforms/desugar/androidTest/debug/1.jar Error while dexing org/assertj/core/api/LongPredicateAssert.class default or static interface method used without --min-sdk-version >= 24

I tried to enable/disable multiDexEnabled in my build.gradle but nothing helped.

My android of build.gradle:

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.**.weather"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner ""
        multiDexEnabled = true
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), ''
    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8


In add android.enableD8=true This should work.

Please note that there is a known bug when you export and upload the apk to play store with d8 enable. The app will not run on some devices when downloaded from play store.

If you're using guava, tou can try to upgrade it to the latest android-specific build

implementation ''

This fixed the error for me when I was using the non-android guava build.

I just have the same error for me, it was because of okhttp and I downgrade implementation of it form:

to this:

implementation "com.squareup.okhttp3:okhttp:3.12.1"

With latest android studio 3.2 and gradle, we can also resolve it via

implementation '' in app build.gradle

add these line to your gradle:

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8

Need Your Help

Python: using 4 spaces for indentation. Why?

python indentation conventions pep8

While coding python I'm using only 2 spaces to indent, sure PEP-8 really recommend to have 4 spaces, but historically for me it's unusual.

Entity Framework defaultconnectionfactory entity-framework entity-framework-4.3

I've recently created a new web project using entity framework 4.3. I'm using database first design.