Zip file app/build/intermediates/app_classes/release/classes.jar' already contains entry 'META-INF/MANIFEST.MF', cannot overwrite

Viewed 1151

When building my Android app with Android-Studio in debug, it works, but when building in release mode, I get the following error at the :app:bundleReleaseClasses step:

Zip file app/build/intermediates/app_classes/release/classes.jar' already contains entry 'META-INF/MANIFEST.MF', cannot overwrite

Building in CLI with ./gradlew assembleDebug (or even ./gradlew bundleReleaseClasses) works.

What could be the reason for this error in Android-Studio, knowing that it works in gradle CLI? I tried excluding this file in packagingOptions {}, but it does not seem to have any effect.

I tried this, this, this, this and a few other related questions, but did not find an answer.

Note that it fails with AGP 7.0.0, 7.0.1, 7.0.2, 7.0.3 and 7.0.4. Not sure if I should try going further back.

1 Answers

Just Update your Gradle plugin version version

I had the same error in Android Studio Chipmunk| 2021.2.1 and Gradle version 7.1.2 and after updating Gradle plugin version to 7.2.0 this problem is resolved.

Related