anber
anber

Reputation: 3655

Build failed after update coroutines to 1.2.0: META-INF/atomicfu.kotlin_module

After update to org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.0 android build failed with issue: More than one file was found with OS independent path 'META-INF/atomicfu.kotlin_module'

Are there any workaround to make it work?

Upvotes: 14

Views: 2904

Answers (2)

Adil Hussain
Adil Hussain

Reputation: 32221

Adding -dontwarn kotlinx.atomicfu.** to my proguard rules file was enough to get my build working with version 1.2.1 of the kotlinx-coroutines-android library.

Adding the packagingOptions { pickFirst('META-INF/atomicfu.kotlin_module') } or packagingOptions { exclude('META-INF/atomicfu.kotlin_module') } block in my build.gradle file didn't work.

Upvotes: 1

Santanu Sur
Santanu Sur

Reputation: 11487

In app-level build.gradle add the following to android level :-

packagingOptions {
    pickFirst("META-INF/atomicfu.kotlin_module")
}

It would look like :-

android {
  .......

  packagingOptions {
    ......
    pickFirst("META-INF/atomicfu.kotlin_module")
  }
}

Upvotes: 18

Related Questions