Błąd: com.android.budowniczy.dexing.DexArchiveBuilderException: nie udało się przetworzyć guava-21.0.jar Android 3.1 Dev Channel

Po aktualizacji moich wersji zależności w AndroidStudio3.1, zacząłem dostawać następujący błąd:

    Information:Gradle tasks [:app:assembleDebug]
Error:com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\Blabla\.gradle\caches\modules-2\files-2.1\com.google.guava\guava\21.0\3a3d111be1be1b745edfa7d91678a12d7ed38709\guava-21.0.jar
Error:com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.
Error:com.android.tools.r8.ApiLevelException: Default interface methods are only supported starting with Android N (--min-api 24): java.util.Collection com.google.common.collect.BiMap.values()
Error:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\Blabla\.gradle\caches\modules-2\files-2.1\com.google.guava\guava\21.0\3a3d111be1be1b745edfa7d91678a12d7ed38709\guava-21.0.jar
Information:BUILD FAILED in 6s
Information:4 errors
Information:0 warnings
Information:See complete output in console

Już posprzątałem i przebudowałem projekt. Sprawdzone przez "multiDexEnabled true" and " compile 'com.android.support:multidex:1.0.2' Dodano.

Co jeszcze mogę zrobić?

EDIT: dodawanie build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId "com.blabla"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
    }

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:27.0.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:multidex:1.0.2'
    compile 'com.android.support:design:27.0.0'
    compile 'com.android.support:cardview-v7:27.0.0'
    compile 'com.jakewharton:butterknife:8.7.0'
    compile 'com.google.code.gson:gson:2.8.0'
    compile 'com.google.guava:guava:21.0'
    compile 'com.microsoft.azure:azure-mobile-android:3.2.0@aar'
    compile 'com.microsoft.azure:notification-hubs-android-sdk:0.4@aar'
    compile 'com.microsoft.azure:azure-notifications-handler:1.0.1@aar'
    compile 'com.squareup.okhttp:okhttp:2.5.0'
    compile 'com.google.firebase:firebase-core:11.4.2'
    compile 'com.google.firebase:firebase-crash:11.4.2'
    compile 'com.google.firebase:firebase-auth:11.4.2'
    compile 'com.google.firebase:firebase-database:11.4.2'
    compile 'com.google.firebase:firebase-storage:11.4.2'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
    compile 'com.google.android.gms:play-services-maps:11.4.2'
    compile 'com.google.android.gms:play-services-location:11.4.2'
    compile 'com.google.maps.android:android-maps-utils:0.5+'
}
apply plugin: 'com.google.gms.google-services'
Author: Atak, 2017-11-06

6 answers

Miałem ten sam problem w react-native project,

Poniższe linijki zadziałały dla mnie,

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
} 
 96
Author: Nandam Mahesh,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-07-02 11:35:20

Zaktualizuj swoją wersję Guava

Guava 21 jest tylko Java 8.

Zaktualizuj gradle do wersji Guava 27.0.1-android, która jest kompatybilna z Androidem:

Gradle 4.6+:

dependencies {
  implementation 'com.google.guava:guava:27.0.1-android'
}

Poprzednie wersje Gradle:

dependencies {
  compile 'com.google.guava:guava:27.0.1-android'
}
 41
Author: Olivier Grégoire,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2019-01-28 12:13:56

Miałem ten sam problem i go rozwiązałem

W Android Studio przejdź do Build -- > Clean Project i po, Build -- > Rebuild Project

Hope it helps

 9
Author: Dani Gee,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-04-17 10:21:23

Miałem podobny przypadek, gdy przełączyłem się na OkHttp 4.x. okazało się, że musiałem wyłączyć profilowanie metody w konfiguracji run: Edit Configurations -> app -> Profiling tab - > odznacz Enable advanced profiling. To rozwiązało mój przypadek, ale nie mogę teraz korzystać z profilowania na starszych urządzeniach.

 4
Author: pkuszewski,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2019-07-29 10:44:18

W moim przypadku otrzymywałem błąd, ponieważ klikałem przycisk Debug 'app', gdy mój wariant kompilacji był ustawiony na release. Kiedy zmieniłem mój wariant kompilacji na debugowanie, a następnie ponownie kliknąłem przycisk debugowania, błąd zniknął. Mam nadzieję, że to komuś pomoże.

 0
Author: Brian Titus,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-04-18 13:04:32

Miałem ten sam problem i moim problemem był konflikt zależności. Szukałam konfliktu poprzez drzewo zależności gradle:

gradlew app:dependencies

Następnie wykluczyłem moduł dla biblioteki kolidującej (np. org.json:json):

api ('<conflicting-library>',{
     exclude group:'org.json', module:'json'
})
 0
Author: Manuel Schmitzberger,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2019-12-13 18:12:41