1

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.

SomeKoder
  • 575
  • 4
  • 14
  • Does this answer your question? [Adding Google Language API results in DuplicateRelativeFileException](https://stackoverflow.com/questions/52671353/adding-google-language-api-results-in-duplicaterelativefileexception) – Andre Classen Nov 25 '19 at 21:09
  • @AndreClassen Sadly not, I have tried this and just tried again to be sure. Super weird. – SomeKoder Nov 25 '19 at 21:11

2 Answers2

3

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'
}
SomeKoder
  • 575
  • 4
  • 14
1

You need to add to add following code to your app/build.gralde

android {
...
    packagingOptions {
        exclude 'META-INF/*.kotlin_module'
    }
...
}
rost3000
  • 11
  • 3
  • I feel like this should have worked, but it didn't, I posted the solution, thanks for the answer regardless – SomeKoder Nov 27 '19 at 00:34
  • This wouldn't work because it's missing the META-INF path. If I'm not mistaken, `**/*.kotlin_module` should have been the wildcard answer. – varcharmander Jan 26 '20 at 01:25