1

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 ?

Lucien Dubois
  • 1,590
  • 5
  • 28
  • 53

1 Answers1

0

After some debugging, it looks like it comes from the splash.png file.

If the file is too big, it looks it won't work. (Anyone knows the maximum file size limit ?)

Solution: use a smaller splash.png image.

Lucien Dubois
  • 1,590
  • 5
  • 28
  • 53
  • I tried to reduce the splash screen size. But after the build, the size of the splash screen increases automatically & build fails again. Did you face this issue? – Ankush Jain Jul 01 '19 at 07:16
  • @AnkushJain It might comes for the splash screen still beign too large – Lucien Dubois Jul 02 '19 at 01:15