【问题标题】:Ionic Cordova Release Build IssueIonic Cordova 发布构建问题
【发布时间】:2019-11-15 17:20:35
【问题描述】:

所以这是调试版本运行良好且没有错误的问题

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

但一切都是徒劳的。期待建议

【问题讨论】:

    标签: android cordova ionic-framework ionic4


    【解决方案1】:

    好的,寻找类似答案的人这些是我尝试过的事情,这是有效的;

    • 更新你的插件
    • 运行科尔多瓦清洁
    • mergeReleaseResources 错误完全基于初始屏幕和应用程序图标资源,因此请手动减小文件大小(如果您的 ionic cordova 资源正在生成更大的文件)

    【讨论】:

      【解决方案2】:

      1) 从 projectName/resources/android 文件夹中删除启动画面图像 2) 重新生成启动画面:

      ionic cordova resources
      

      3) 现在构建 android

      【讨论】:

      • 我试过这个,因为它在另一个论坛中提到过,但这对我不起作用。
      • 飞溅和图标是否生成?
      • 是的,它是生成的,但是生成的图像的文件很大,所以我不得不手动把它变小
      猜你喜欢
      • 2019-08-01
      • 2019-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-26
      • 2020-11-23
      • 2018-08-31
      • 2021-11-01
      相关资源
      最近更新 更多