Reputation: 905
I get this error when trying to import a dependency. The stripe SDK to be precise.
implementation 'com.stripe:stripe-android:12.5.0'
More than one file was found with OS independent path 'META-INF/sdk_release.kotlin_module'
Removing the implementation removes the problem, I've tried solutions like this without any success.
Here's a more detailed build error.
com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'META-INF/sdk_release.kotlin_module' at com.android.builder.merge.StreamMergeAlgorithms.lambda$acceptOnlyOne$2(StreamMergeAlgorithms.java:75) at com.android.builder.merge.StreamMergeAlgorithms.lambda$select$3(StreamMergeAlgorithms.java:100) at com.android.builder.merge.IncrementalFileMergerOutputs$1.create(IncrementalFileMergerOutputs.java:86) ...
Any ideas? Thanks a lot.
Upvotes: 1
Views: 1243
Reputation: 11
You need to add to add following code to your app/build.gralde
android {
...
packagingOptions {
exclude 'META-INF/*.kotlin_module'
}
...
}
Upvotes: 1
Reputation: 905
Other answers were close, I had to this to the app/build.gradle to get it excluded properly.
packagingOptions {
exclude 'META-INF/sdk_release.kotlin_module'
}
Upvotes: 3