我正在尝试通过 Android Studio > Generate Signed Bundle or APK > Android App Bundle > Release 构建发布应用程序
然而 gradle 失败了
: > Task :core:transformClassesWithMergeClassesForRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':core:transformClassesWithMergeClassesForRelease'.
> 1 exception was raised by workers:
java.util.zip.ZipException: duplicate entry: META-INF/app_release.kotlin_module
在我的
build.gradle
我试过添加: packagingOptions {
exclude 'META-INF/app_release.kotlin_module'
}
但它没有任何区别。
我该如何解决?
对于额外的上下文,它是一个多模块项目。
我有一个
core
模块和 installed
在 core
中声明的模块build.gradle
与 dynamicFeatures = [":installed"]
谢谢
最佳答案
请确保您的所有依赖项都是 api
或 implementation
,
我有流动的依赖关系。
meemo_sdk:
接口(interface) 项目(“:gvoice”)
应用项目:
实现项目(":gvoice")
实现项目(“meemo_sdk”)
它提示“META-INF/gvoice_debug.kotlin_module”冲突。
将 api 更改为 implementation 后,它可以工作!
关于Android Gradle 构建 : duplicate entry: META-INF/app_release. kotlin_module,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57482906/