首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >更改Gradle文件后出现DexArchiveBuilderException

更改Gradle文件后出现DexArchiveBuilderException
EN

Stack Overflow用户
提问于 2018-09-20 04:20:07
回答 2查看 361关注 0票数 0

我试图使用一个新的API,但当我更改依赖项时,错误开始一个接一个地出现。

当我添加这一行implementation 'com.yandex.android:mapkit:3.0.0'时,这一行中断了。implementation 'com.android.support:appcompat-v7:28.0.0-rc02'。Android Studio建议我添加//noinspection GradleCompatible,所以我添加了。但现在我的应用不能运行了。说:

原因:dexing时出现com.android.builder.dexing.DexArchiveBuilderException:错误。

原因: java.lang.ArrayIndexOutOfBoundsException:-2147483648原因: com.android.builder.dexing.DexArchiveBuilderException:无法处理/home/melkor/.gradle/caches/transforms-1/files-1.1/runtime-3.0.0.aar/fba329a4af9f160a1109c717ee93ced1/jars/classes.jar

这是我的android清单

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.melkor.testyandex"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
repositories {
    maven {
        url "http://maven.google.com/"
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.yandex.android:mapkit:3.0.0'
}
EN

回答 2

Stack Overflow用户

发布于 2018-09-20 04:30:34

尝试在gradle.properties文件中添加android.enableD8=true

票数 0
EN

Stack Overflow用户

发布于 2018-09-20 13:20:41

'com.yandex.android:mapkit:3.0.0'依赖于support-compat和support-v4版本27.0.0。所以,问题可能是由于库的冲突造成的。尝试使用支持库版本27.0.0而不是28.0.0.-rc2

代码语言:javascript
复制
implementation 'com.android.support:appcompat-v7:27.0.0' 

请注意,版本28.0.0.-rc2是一个发布候选版本,预计会出现一些崩溃。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52413654

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档