java - 执行另一个模块时任务':android:mergeDexDebug'执行失败
问题描述
尝试运行我的 android libgdx 应用程序时出现错误。
我尝试将 multidex 设置为 true 但这只会带来不同的问题。也使我的缓存无效。当删除该行以实现“client_core”时,它开始工作。我在 IntelliJ 中编程。
android模块的build.gradle
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "de.unkn0wn.pong"
minSdkVersion 18
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
}
configurations { natives }
dependencies {
implementation project(":client_core") //Commenting this line out "fixes" the problem
implementation "com.badlogicgames.gdx:gdx-backend-android:1.9.10"
natives "com.badlogicgames.gdx:gdx-platform:1.9.10:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:1.9.10:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:1.9.10:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-platform:1.9.10:natives-x86"
natives "com.badlogicgames.gdx:gdx-platform:1.9.10:natives-x86_64"
natives "com.badlogicgames.gdx:gdx-freetype-platform:1.9.10:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-freetype-platform:1.9.10:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:1.9.10:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:1.9.10:natives-x86"
natives "com.badlogicgames.gdx:gdx-freetype-platform:1.9.10:natives-x86_64"
}
...
client_core 模块的 build.gradle
plugins {
id 'java'
}
dependencies {
compile project(':core')
implementation "com.badlogicgames.gdx:gdx-freetype:1.9.10"
}
在模拟器或真机上尝试在 IntelliJ 中运行时出现以下错误:
Execution failed for task ':android:mergeDexDebug'
Could not resolve all files for configuration ':android:debugRuntimeClasspath'
Failed to transform artifact 'client_core.jar (project :client_core)' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=18, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.jvm.version=11, org.gradle.usage=java-runtime-jars}
Execution failed for DexingTransform: /home/marcel/Dokumente/Pong/client_core/build/libs/client_core.jar
解决方案
推荐阅读
- python - 如果键是python中的数字,有没有办法按键对字典进行排序?
- reactjs - 如何使用material-ui的网格系统将5个项目均匀地排列成一行?
- apache-nifi - Jolt:Nifi 中的拆分/连接数组值
- c# - 未找到 WPF ShowDilaog()
- python - 如何在单击 cli 中使用 python 日志输出日志?
- javascript - 使其可编辑后如何编写内部输入?
- java - 如何按内存位置对集合中的对象进行排序?
- assembly - 如何验证 LR/SC 序列的约束(RISC-V ISA)
- javascript - 如何在用户创建后使用 Angular 中的 Firebase 身份验证同步登录用户?
- docker - Docker 构建只需要 1 个参数