Cordova 14 – APK already contains entry ‘AndroidManifest.xml’, cannot overwrite

  Kiến thức lập trình

I upgraded my Cordova project to Cordova Android 13 which increases the target SDK to 34 (Android 14).

Now, I get the following error when I built my app:

> Task :app:packageRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageRelease'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
   > Zip file '/Users/xxx/yyy/platforms/android/app/build/outputs/apk/release/app-release.apk' already contains entry 'AndroidManifest.xml', cannot overwrite

Before, I used the solution explained here (add android.useNewApkCreator=false in gradle.properties), but it seems no more compatible with Gradle 8.7, as I get this error when I

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/xxx/yyy/platforms/android/app/build.gradle' line: 20

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
   > com.android.builder.errors.EvalIssueException: The option 'android.useNewApkCreator' is deprecated.
     The current default is 'true'.
     It was removed in version 8.0 of the Android Gradle plugin.

I would like to know how could I fix this problem, thanks!

LEAVE A COMMENT