IT박스

Error : com.android.builder.dexing.DexArchiveBuilderException : guava-21.0.jar Android 3.1 개발자 채널 처리 실패

itboxs 2020. 11. 27. 07:55
반응형

Error : com.android.builder.dexing.DexArchiveBuilderException : guava-21.0.jar Android 3.1 개발자 채널 처리 실패


에서 내 종속성 버전을 업데이트 한 후 AndroidStudio3.1다음 오류가 발생하기 시작했습니다.

    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

나는 이미 프로젝트를 청소하고 재건했습니다. 내 확인 "multiDexEnabled true"하고 '컴파일 'com.android.support:multidex:1.0.2'이 추가되었습니다.

그 밖에 무엇을 할 수 있습니까?

편집 : 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'

반응 네이티브 프로젝트에서 동일한 문제가 발생했습니다.

아래 줄이 저에게 효과적이었습니다.

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
} 

Guava 버전 업데이트

Guava 21은 Java 8 전용입니다.

27.0.1-androidAndroid와 호환되는 Guava 버전으로 gradle을 업데이트합니다 .

Gradle 4.6 이상 :

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

이전 Gradle 버전 :

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

나는 같은 문제가 있었고 청소 프로젝트를 해결하고 재건했습니다.

Android Studio에서 Build-> Clean Project 로 이동 한 다음 Build-> Rebuild Project로 이동합니다.

도움이되기를 바랍니다.


I had the similar case when I switched to OkHttp 4.x. It turned out that I had to disable the method profiling in run configuration: Edit Configurations -> app -> Profiling tab -> uncheck Enable advanced profiling. It solved my case but I cannot use profiling now on older devices.


In my case, I was getting the error because I was clicking the Debug 'app' button while my build variant was set to release. When I changed my build variant to debug, then clicked the Debug button again, the error went away. I hope this helps someone.

참고URL : https://stackoverflow.com/questions/47136718/errorcom-android-builder-dexing-dexarchivebuilderexception-failed-to-process-g

반응형