我正在努力解决Android Studio
Unable to create debug or signed apk
的问题。
Task :app:multiDexListDebug FAILED
Task :app:multiDexListDebug in app Finished
:app:multiDexListDebug (Thread[Daemon worker Thread 2,5,main]) completed. Took 2.62 secs.
AAPT2 aapt2-3.5.2-5435860-linux Daemon #0: shutdown
失败:构建失败,并出现异常。
出了什么问题:
Execution failed for task ':app:multiDexListDebug'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$actionFacade
Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: kotlin.StandardKt__SynchronizedKt
场景已尝试:
- 已启用
multidex
是 - 添加了依赖项
Multidex 2.0.1
(android x) - 清理和重建项目
- 从主要项目中排除
org.jetbrains.kotlin
。 - 使用
api
和runtimeonly