简体   繁体   English

Ionic Cordova发行版本发行

[英]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 ) mergeReleaseResources错误完全基于初始屏幕和应用程序图标资源,因此请手动减小文件大小(如果您的ionic cordova资源正在生成较大的文件)

1) Delete splash screen images from projectName/resources/android folder 2) Regenerate splash screen : 1)从projectName / resources / android文件夹中删除初始屏幕图像2)重新生成初始屏幕:

ionic cordova resources

3) Now build android 3)现在建立android

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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