所以这是调试版本可以正常工作且没有错误的问题
Ionic cordova run android --device
但是当我尝试生成发布版本时,出现以下错误
* 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.
我尝试使用多次生成资源
ionic cordova recources
但是都是徒劳的。期待建议
最佳答案
好吧,正在寻找相似答案的人们,这些都是我尝试过的,这是行之有效的。
更新您的插件
运行科尔多瓦干净
mergeReleaseResources错误完全基于初始屏幕和应用程序图标资源,因此请手动减小文件大小(如果您的ionic cordova资源正在生成较大的文件)
关于android - Ionic Cordova发行版本发行,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/56896868/