5

In project i am using kotlin dsl, jetpack compose, com.android.tools.build:gradle:7.0.0-alpha08, many modules and i am continuously getting this error.

Zip file 'E:\project_name\module_name\build\intermediates\compile_library_classes_jar\debug\classes.jar' already contains entry 'META-INF/module_name_debug.kotlin_module', cannot overwrite

Any combinations of exclude/pickFirst/merge

packagingOptions {
        exclude/pickFirst/merge("META-INF/module_name_debug.kotlin_module")
    } 

just doesnt work.

Is there some solution?

Kochchy
  • 591
  • 1
  • 6
  • 17
  • Do you actually have two nested `META-INF` in "Any combinations of... just doesnt work"? – Alexey Romanov Mar 02 '21 at 21:38
  • thats actualy a typo, edited now – Kochchy Mar 04 '21 at 09:09
  • @Kochchy Have you got a chance to find any workaround? – Dimitar Genov Mar 16 '21 at 19:28
  • @DimitarGenov only solution was to demodularize the app – Kochchy Apr 13 '21 at 15:15
  • 1
    @Kochchy I had a ticket for this issue. It gave me a good amount of grief. https://issuetracker.google.com/issues/183632446 There are 2 ways which resolved my issue (and I had tried anything): 1) use latest Intellij IDEA (published a week ago) 2) use Android Studio 4.2 RC1. Any other Android Studio fails mightly on my machine. I hope this helps. – Dimitar Genov Apr 14 '21 at 18:33
  • @DimitarGenov im using Jetpack Compose so i have to use Android Studio Canary – Kochchy Apr 15 '21 at 13:33
  • @Kochchy, were you ever able to fix this besides demodularizing the app? I'm also having the same issue. – Nick Sep 01 '21 at 00:18

3 Answers3

3

reference to : issuetracker.google.com/issues/183632446

disable Make Project Automatically option under:

Preferences | Build, Execution, Deployment | Compiler

enter image description here

zyc zyc
  • 3,805
  • 1
  • 14
  • 14
1

just delete the build ( E:\project_name\module_name\build ) folder and rebuild the project

Max
  • 5,380
  • 6
  • 42
  • 66
0

If you are on Bumblebee and higher. Make project automatically(only works while not running/debugging) option has been removed.

Upgrading your project to use the latest version of gradle in build.gradle and gradle.properties should fix this error. For my current project I'm using this in build.gradle

classpath "com.android.tools.build:gradle:7.1.1"

gradle.properties

distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME