androidkotlinconflicting-libraries

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


I recently added two Android libraries through JitPack and I have the following error:

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

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

exclude group: 'org.jetbrains'

and

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)


Solution

  • You should add this to the build.gradle file of your app inside the android tag

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