我最近通过JitPack添加了两个Android库,我有以下错误:

Duplicate files copied in APK META-INF/library_release.kotlin_module

I've cleared the cached 和 I've tried excluding the module using

exclude group: 'org.jetbrains'

exclude group: 'org.jetbrains.kotlin'

but neither seems to resolve the issue. Is there any way to stop the kotlin stdlib from being added through JitPack? Oddly, other libraries like DbFlow don't have this issue, though I don't see anything special about their setup (other than that it isn't through JitPack)

推荐答案

您应该将其添加到应用程序的build.gradle文件的android标签内

packagingOptions {
    exclude 'META-INF/library_release.kotlin_module'
}

Kotlin相关问答推荐

有什么原因,我得到一个空相关的错误在这个代码

在KMP中使用koin将来自Android的上下文注入到SQLDelight Driver中

Android Jetpack编写androidx.compose.oundation.lazy.grid.Items

在Kotlin 有更好的结合方式?

某些公共函数显然不能在类实例上访问;Klaxon示例

使函数同时挂起和取消挂起

创建包含 3 个相同项目的列表/使用返回类型重复

为什么 Kotlin 在将协变类型参数转换为不变类型参数时会产生 Unchecked Cast 警告?

Kotlin 中的as Long和.toLong()有什么区别?

如何使用子变量在 Kotlin 中初始化父级

T except one class

异常传播如何在 CoroutineScope.async 上工作?

Kotlin 中列表或数组的乘积

无法在 kotlin android 中以编程方式禁用 EditText

如何在 kotlin 中生成 json 对象?

如何在 Android Studio 3.1.3 中查看 Kotlin 中有趣的源代码?

如何在kotlin语言中将字符转换为ascii值

Kotlin reflect proguard SmallSortedMap

在 Kotlin 函数上使用 Mokito anyObject() 时,指定为非 null 的参数为 null

Kotlin反射不可用