I'm using the ionic run command to generate an apk. As soon as I put the --release tag, it throws two errors. It seems it's related to the resources.
Cordova command
ionic cordova build android --release --prod --verbose
Errors
Execution failed for task ':app:mergeReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.3.0-5013011-windows
Daemon #0: Unexpected error during compile '..\platforms\android\app\src\main\res\drawable-port-xxxhdpi\screen.png', attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
and
Exception in thread "ForkJoinPool.commonPool-worker-0" java.lang.IllegalStateException: AAPT Process manager cannot be shut down while daemons are in use
I tried the following:
ionic cordova platform rm android
ionic cordova platform add android
ionic cordova resources -f
Additional informations:
My Gradle version is 5.4.1, it's added to PATH and Android Studio is configured to use this specific version.
What could be the problem ?