Android Studio 3.0 DexArchiveBuilderException [英] Android Studio 3.0 DexArchiveBuilderException

查看:2232
本文介绍了Android Studio 3.0 DexArchiveBuilderException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


错误:com.android.builder.dexing.DexArchiveBuilderException:未能进程/Users/rafaelruizmunoz/SourceTree/Weather/app/build/intermediates/transforms/desugar/androidTest/debug/1.jar



错误:com.android.builder。 dexing.DexArchiveBuilderException:dexing org / assertj / core / api / LongPredicateAssert.class时出错

错误:com.android.dx.cf.code.SimException:默认或静态我试过启用/禁用 multiDexEnabled 在我的 build.gradle 中没有任何帮助。



我的 build.gradle

  android {
compileSdkVersion 27
defaultConfig {
applicationIdcom。**。weather
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName1.0
testInstrumentationRunnerandroid.support.test.runner.AndroidJUnitRunner
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8



解决方案

gradle.properties 中添加 android.enableD8 = true 这应该有效。



请注意,当您使用d8启用导出并上传APK以玩商店时,存在已知的错误。该应用在从Play商店下载时不会在某些设备上运行。



https://issuetracker.google.com/issues/64740479


I'm having this error whilst compiling Instrumentation tests.

Error:com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/rafaelruizmunoz/SourceTree/Weather/app/build/intermediates/transforms/desugar/androidTest/debug/1.jar

Error:com.android.builder.dexing.DexArchiveBuilderException: Error while dexing org/assertj/core/api/LongPredicateAssert.class

Error:com.android.dx.cf.code.SimException: 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 "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
}

解决方案

In gradle.properties 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.

https://issuetracker.google.com/issues/64740479

这篇关于Android Studio 3.0 DexArchiveBuilderException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆