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.