Good day. I've written a kotlin android library and uploaded it on bintray. But when I try to use it (via gradle compile) in some project, it fails to build with following errors:
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/library_release.kotlin_module
File1: C:\Users\Charlie\.android\build-cache\2939fbc6b0336396c9c4912d615880645b2c729d\output\jars\classes.jar
File2: C:\Users\Charlie\OneDrive\Dev\Projects\AndroidStudio\MetuCardLib\demo\build\intermediates\bundles\default\classes.jar
这两个我都查过了.jar文件,它们都包含META-INF
个文件夹和library_release.kotlin_module
个文件.但更重要的是,它产生了.aar(在bintray中发布的android archive)包含此文件夹和此文件.我查看了其他一些不错的android库,它们似乎没有包含任何META-INF
个文件.然而,那些包含它的(在大多数情况下,它们包含许可证文件)会产生相同的DuplicateFileException
,解决方法是在使用project的gradle文件中明确排除它们.
这个library_release.kotlin_module
文件有什么用途?我如何在发布过程中禁用它的生成?因为我不想明确地从每个使用这个库的项目中排除,我也不想要求其他开发人员这样做.
Here's the library's repo: https://github.com/arslancharyev31/Anko-ExpandableTextView/ And it's bintray repo: https://bintray.com/arslancharyev31/android/Anko-ExpandableTextView