Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicate entry: META-INF/atomicfu.kotlin_module #1064

Closed
SUPERCILEX opened this Issue Mar 31, 2019 · 24 comments

Comments

Projects
None yet
8 participants
@SUPERCILEX
Copy link
Contributor

commented Mar 31, 2019

I've tried this and it doesn't work. I'm a bit stuck. 馃槩

@eakteam

This comment has been minimized.

Copy link

commented Mar 31, 2019

@SUPERCILEX , i have tried with

packagingOptions {
        pickfirst 'META-INF/atomicfu.kotlin_module'
}
packagingOptions {
        pickfirst 'META-INF/*'
}
packagingOptions {
        pickfirst '**'
}

and it is not working too !

@kherlopian2

This comment has been minimized.

Copy link

commented Mar 31, 2019

packagingOptions {
        pickFirst 'META-INF/kotlinx-io.kotlin_module'
        pickFirst 'META-INF/atomicfu.kotlin_module'
        pickFirst 'META-INF/kotlinx-coroutines-io.kotlin_module'
    }

that worked with me.

@eakteam

This comment has been minimized.

Copy link

commented Mar 31, 2019

@kherlopian2 , for me still not working. I mean it's OK in Debug build, but not in release

@SUPERCILEX

This comment has been minimized.

Copy link
Contributor Author

commented Mar 31, 2019

@kherlopian2 Nope, not working. 馃槩 @eakteam Are you using dynamic feature feature modules or instant apps?

@eakteam

This comment has been minimized.

Copy link

commented Mar 31, 2019

@SUPERCILEX , Yes i am using Dynamic Feature Modules and this packaging options rules i have added in every build.gradle

@SUPERCILEX

This comment has been minimized.

Copy link
Contributor Author

commented Mar 31, 2019

Neat, so that's gotta be the bug somehow! I want to hear @qwwdfsad's thoughts, but then I'll file an issue if it's really Google's fault.

@eakteam

This comment has been minimized.

Copy link

commented Mar 31, 2019

@SUPERCILEX , sure that this is a minor bug and for sure it will be solved, but @qwwdfsad i think its not his fault and maybe it is related really to Android Build Tollchain. I have opened a bug for this in 26 March and they have reviewed it :

https://issuetracker.google.com/issues/129323351

I am using latest Android Studio 3.5 Canary 9. @SUPERCILEX what Android Studio version do you use ? I mean this is happening in every version since latest coroutine release or only to 3.5 canary 9 version ?

@SUPERCILEX

This comment has been minimized.

Copy link
Contributor Author

commented Mar 31, 2019

Dope. And I've tried going back to alpha 6 I think. Still broken so it was definitely introduced by coroutines. Still seems like a tooling bug though. 馃し鈥嶁檪锔

@eakteam

This comment has been minimized.

Copy link

commented Mar 31, 2019

@SUPERCILEX , i understand , thanks for saving time not leaving me to downgrade too :D :D ... It will be fixed don't worry, it is just a very minor issue. I downgrade to 1.1.1 of coroutines but needed to fix this just for curiosity to test how the new version works ....

And some bug are normal, it is just Alpha version.
Best Regards, if they reply me to the bug report on Google i will reply back here to you to let you know, or just star that issue to stay updated

@eakteam

This comment has been minimized.

Copy link

commented Mar 31, 2019

@SUPERCILEX , thanks for providing Google with open source project, it is really important and they will solve this for sure in this way. I can't share mine because is Close Source, so thank you for supporting !
Best Regards

@eakteam

This comment has been minimized.

Copy link

commented Apr 1, 2019

@SUPERCILEX , i have solved id by adding this in my app gradle file

configurations {
        compile.exclude group: 'org.jetbrains.kotlinx', module: 'atomicfu-common'
    }
@LouisCAD

This comment has been minimized.

Copy link
Contributor

commented Apr 1, 2019

Same problem with version 1.2.0-alpha on my side.
Here's the error:

> Task :sample:mergeDebugJavaResource FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sample:mergeDebugJavaResource'.
> 1 exception was raised by workers:
  com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'META-INF/atomicfu.kotlin_module'

And here's a permalink to a reproducing project: https://github.com/LouisCAD/Splitties/tree/e2389213a82aa91ca4ecf4a05fc67438e7c5ffd0
You can try it by just running ./gradlew :sample:assembleDebug.

Also, as @kherlopian2 said, adding this in the android { ... } block in build.gradle.kts can workaround that issue:

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

This comment has been minimized.

Copy link
Contributor Author

commented Apr 1, 2019

@eakteam doesn't that break things at runtime though?

@eakteam

This comment has been minimized.

Copy link

commented Apr 1, 2019

@SUPERCILEX , No, for me everything is running OK. There are 2 modules in group org.jetbrains.kotlinx

Remember to exclude only atomicfu-common module

LouisCAD added a commit to LouisCAD/Splitties that referenced this issue Apr 2, 2019

@qwwdfsad qwwdfsad added the question label Apr 3, 2019

@qwwdfsad

This comment has been minimized.

Copy link
Member

commented Apr 3, 2019

Thanks for the reproducer and possible workarounds!
kotlin_module file is generated and used by the compiler, so we have no control over it.

This issue will be solved in 1.3.40 on the compiler side: https://youtrack.jetbrains.com/issue/KT-30344
And in AS independently: https://issuetracker.google.com/issues/125696148

I will leave the issue open for a while to make it easier for users to find a workaround.

@JakeWharton

This comment has been minimized.

Copy link
Contributor

commented Apr 3, 2019

If you're using Gradle you can specify archivesBaseName to generate modules with different names (and thus different .kotlin_module file names) to avoid collisions.

@eakteam

This comment has been minimized.

Copy link

commented Apr 4, 2019

I don't understand why this is not solved yet in alpha-2 but we should use still the workaround ?

@JakeWharton

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2019

@eakteam

This comment has been minimized.

Copy link

commented Apr 4, 2019

Hmmmm, but this can contains in the aar the workaround to simplify things for new users, than after it is finally solved can edit back ... Anyway just my thoughts.

@Pranipus

This comment has been minimized.

Copy link

commented Apr 5, 2019

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

Can confirm this worked for me^.

@eakteam

This comment has been minimized.

Copy link

commented Apr 12, 2019

This issue is still happening with latest Kotlin 1.3.30 and latest Coroutines 1.2.0.
I don't know if should be fixed by next Android Studio version or by Kotlin or Coroutines library
We still need to implement the workarounds to skip the failure about duplicate entry

tateisu added a commit to tateisu/SubwayTooter that referenced this issue Apr 12, 2019

@qwwdfsad

This comment has been minimized.

Copy link
Member

commented Apr 13, 2019

This issue is still happening with latest Kotlin 1.3.30 and latest Coroutines 1.2.0.

It was told before that it is not the library issue and that on Kotlin side it will be fixed in 1.3.40 and in AS 3.5 Canary 12.

@eakteam

This comment has been minimized.

Copy link

commented Apr 13, 2019

@qwwdfsad , sorry i have missed that comment 馃槉.
Thanks for confirming it !

1951FDG added a commit to 1951FDG/openpyn-nordvpn-juiceSSH that referenced this issue Apr 14, 2019

elizarov added a commit that referenced this issue Apr 20, 2019

Fix atomicfu post-processing and dependencies
* Update to atomicfu 0.12.4, which fixes plugin operation with
  kotlin-multiplatform
* Remove explicit dependencies (plugins adds them automatically)

Fixes #1116
Fixes #1064
@elizarov

This comment has been minimized.

Copy link
Collaborator

commented Apr 20, 2019

It looks that is a side-effect of leaked atomicfu dependency. atomicfu.kotlin_module will disappear in version 1.2.1. See #1120

@elizarov elizarov added this to the 1.2.1 milestone Apr 20, 2019

elizarov added a commit that referenced this issue Apr 21, 2019

Fix atomicfu post-processing and dependencies
* Update to atomicfu 0.12.4, which fixes plugin operation with
  kotlin-multiplatform
* Remove explicit dependencies (plugins adds them automatically)

Fixes #1116
Fixes #1064

elizarov added a commit that referenced this issue Apr 22, 2019

AtomicFu version 0.12.5
This should really fix processing of class files

Fixes #1116
Fixes #1064

elizarov added a commit that referenced this issue Apr 23, 2019

AtomicFu version 0.12.5
This should really fix processing of class files

Fixes #1116
Fixes #1064

@elizarov elizarov added bug and removed question labels Apr 24, 2019

@qwwdfsad qwwdfsad closed this in e1ac2e5 Apr 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.