Entry name 'META-INF/sdk_debug.kotlin_module' collided

Studio Build: 4.3.1, 4.2.0 Beta06, 4.3.0 Alpha 11
Version of Gradle Plugin: 4.3.1, 4.2.0-beta06, 7.0.0-alpha11
Version of Gradle: 6.8.3
Version of Java: Java 8, and then Java 15
OS: Mac OS 11.2.3

I have tried all possible ways to tackle this issue.
And I’ve looked at any previous issues, resolutions, stackoverflow advises, you name it.

Here are all the cases I’ve tried, no success whatsoever:

I’ve tried below, and then replaced with pickFirst(), still an issue:

packagingOptions {
  exclude "META-INF/*.kotlin_module"
  exclude "META-INF/rxkotlin.properties"
  exclude "META-INF/rxkotlin_main.kotlin_module"
  exclude "META-INF/kotlinx-io.kotlin_module"
  exclude "META-INF/atomicfu.kotlin_module"
  exclude "META-INF/kotlinx-coroutines-io.kotlin_module"
  exclude "META-INF/rxkotlin.properties"
  exclude "META-INF/rxkotlin_main.kotlin_module"

Here is a link of the dummy github project. Please open /test_app folder in Android Studio.

Sync and clean project resolves the issue randomly on the provided simple example. But then after restarting and repeating the steps above, it will start happening again.

This issue happens constantly on more complex projects.

When you open the sample for the first time, it will most likely work.

Please close it at least once, and after opening, make sure you:

  • Sync project with Gradle files
  • Build > Clean project

In the 2nd or 3rd attempt after restarting the project, you will start seeing the error when trying to compile.
And from there onward, every compilation fails. Cleaning, restarting, wiped .gradle cache, even under my mac folder.
Still happily failing.

I have opened an issue:

But this is a critical problem for our team, hence I am trying to expand possible ideas how to deal with this problem.

Right now we are stuck.

A little more on the issue, since this is critical for us, and need to continue hitting the wall.

After a failed compilation, I’ve started to Force Quit any Java open processes in my mac (from MacOS Activity Monitor).
Then same procedure - Sync Project with Gradle Files and then Build > Clean, and finally Run App.
Eventually after 10-ish retries compilation went through.

But then it comes back randomly, and I need to repeat the same kill threads ceremony.

Hence still stuck.

I don’t really know how to help you there since I never had this problem.
I have 3 suggestions for you though:

  1. You should maybe also open an issue with the kotlin team at https://kotl.in/issue. While some of the kotlin devs are active here, creating an issue at the kotlin bug tracker won’t hurt :wink:
  2. I can’t speak for other people but I generally don’t open zip files from random people on the internet. While I doubt that you are would put any virus or anything in there it’s still not something I do. That said I’d normaly be happy to take a look if you upload your sample project to github, etc, but I currently don’t have access to a mac. Maybe someone else does though
  3. I think you missed sharing your kotlin version. It might matter, it might not. Also if you haven’t yet, try updating to the latest version.

Thank you @Wasabi375

All 3 suggestions are doable.
I will create an open github project and will post the link soon here.

All right, github project created, links updated in the original post above.