When I added my MPP library to an Android project as a dependency, I started getting
More than one file was found with OS independent path
when trying to build it. Googled it up a little bit, and came up with this workaround (to be placed in the
build.gradle
of the library consumer):
android {
packagingOptions {
pickFirst 'META-INF/ktor-http.kotlin_module'
pickFirst 'META-INF/kotlinx-io.kotlin_module'
pickFirst 'META-INF/atomicfu.kotlin_module'
pickFirst 'META-INF/ktor-utils.kotlin_module'
pickFirst 'META-INF/kotlinx-coroutines-io.kotlin_module'
pickFirst 'META-INF/ktor-client-core.kotlin_module'
}
}
Now the compiler is happy. But is there no other solution? Not a deal breaker for me, but would like to address the core of the issue instead of having this floppy workaround.