title: Zip file app/build/intermediates/app_classes/release/classes.jar' already contains entry 'META-INF/MANIFEST.MF', cannot overwrite
body: <p>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 <code>:app:bundleReleaseClasses</code> step:</p>
  <pre><code>Zip file app/build/intermediates/app_classes/release/classes.jar' already contains entry 'META-INF/MANIFEST.MF', cannot overwrite
  </code></pre>
  <p>Building in CLI with <code>./gradlew assembleDebug</code> (or even <code>./gradlew bundleReleaseClasses</code>) works.</p>
  <p>What could be the reason for this error in Android-Studio, knowing that it works in gradle CLI? I tried excluding this file in <code>packagingOptions {}</code>, but it does not seem to have any effect.</p>
  <p>I tried <a href="https://stackoverflow.com/questions/66439933/classes-jar-already-contains-entry-meta-inf-module-name-debug-kotlin-module">this</a>, <a href="https://stackoverflow.com/questions/58787269/gradle-duplicate-entry-error-meta-inf-manifest-mf-or-how-to-delete-a-file-from">this</a>, <a href="https://stackoverflow.com/questions/56626654/buildprebundle-failed-duplicate-entry-meta-inf-manifest-mf">this</a>, <a href="https://stackoverflow.com/questions/63387854/entry-name-meta-inf-manifest-mf-collided-when-building-for-api-21-emulator-as">this</a> and a few other related questions, but did not find an answer.</p>
  <p>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.</p>