https://kotlinlang.org logo
#android
Title
# android
f

Fredrik Larsen

05/27/2019, 10:41 AM
Hi, I'm having an issue building a release build
More than one file was found with OS independent path 'META-INF/core-ktx_release.kotlin_module'
Yes, I have a module named
core-ktx
and I'm guessing some other library has the same? I know you can exclude or pickFirst under packagingOptions, but I'm afraid that that will break something. As far as I know the
kotlin_module
is actually used by kotlin for various tasks. What is the proper solution here? I can rename the module, but this issue is bound to happen again. I find it peculiar that FQN is not used for this, but it's a bit over my head.
r

ribesg

05/27/2019, 11:26 AM
I still have no problem using this in my app:
Copy code
packagingOptions {
        exclude("META-INF/*.kotlin_module")
    }
I heard that the
kotlin_module
file can be used by reflection, but that’s it. It’s something that should be packaged with libraries (
aar
) but not applications, unless you know that you need it. So my strategy is to just exclude everything and I’ll think about it when (if) I encounter an error
f

Fredrik Larsen

05/27/2019, 11:42 AM
Interesting. I figured it would be a problem with reflection for modules as well. I'll try your approach. Thanks
a

Alexey Belkov [JB]

05/27/2019, 3:08 PM
Also, the reflection problem should be fixed in 1.3.40 AFAIU: https://youtrack.jetbrains.com/issue/KT-30344
👍 1