简体   繁体   中英

Ionic Cordova Release Build Issue

So here is the issue the debug build works great with no error

Ionic cordova run android --device

but when i try to generate a release build i get the following error

    * What went wrong:
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 'D:\Development\ionic\DummyGPS\platforms\android\app\src\main\res\drawable-land-xhdpi\screen.png', attempting to stop daemon.
  This should not happen under normal circumstances, please file an issue if it does.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
Exception in thread "ForkJoinPool.commonPool-worker-1" java.lang.IllegalStateException: AAPT Process manager cannot be shut down while daemons are in use
        at com.android.builder.internal.aapt.v2.Aapt2DaemonManager.shutdown(Aapt2DaemonManager.kt:96)
        at com.android.build.gradle.internal.res.namespaced.RegisteredAaptService.shutdown(Aapt2DaemonManagerService.kt:61)
        at com.android.build.gradle.internal.workeractions.WorkerActionServiceRegistry$shutdownAllRegisteredServices$1$1.run(WorkerActionServiceRegistry.kt:96)
        at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
[ERROR] An error occurred while running subprocess cordova.

        cordova.cmd build android --release exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

I have tried generating resources multiple time using

ionic cordova recources

But all in vain. look forward for suggestions

Ok The people looking for similar answers these are the things i tried and this is what worked;

  • Update your plugins
  • run cordova clean
  • mergeReleaseResources error is totally based on splash screen and app icon resources so reduce the file size manually ( if your ionic cordova resources is generating larger files )

1) Delete splash screen images from projectName/resources/android folder 2) Regenerate splash screen :

ionic cordova resources

3) Now build android

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM