我试图使用一个新的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清单
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'
}
发布于 2018-09-20 04:30:34
尝试在gradle.properties文件中添加android.enableD8=true
。
发布于 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
implementation 'com.android.support:appcompat-v7:27.0.0'
请注意,版本28.0.0.-rc2
是一个发布候选版本,预计会出现一些崩溃。
https://stackoverflow.com/questions/52413654
复制相似问题