Ionic build 命令运行良好,直到我决定添加一些自定义启动画面并运行以下命令,
ionic resources
每次运行构建命令时,我都会在运行构建命令时遇到以下错误,
:mergeDebugResourcesAAPT err(Facade for 35126910): libpng error: Read Error FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':mergeDebugResources'.
Some file crunching failed, see logs for details
尝试:
构建失败
这么清楚,ionic resources
命令产生了一些问题。
请帮忙!
最佳答案
查阅了多个网上资源,发现ionic resources
处理/优化生成的 PNG 文件。
发布该信息,当您运行时 ionic build android
命令,Android 构建本身会尝试在已处理/优化的启动画面上工作,但效果不佳并报告错误。
因此,修复方法是告诉 Android Build 根本不要接触这些 PNG 文件,而是继续执行它给出的内容。怎么做?
把 cruncherEnabled = false
在 platforms\android\build.gradle
文件如下,
android {
aaptOptions {
cruncherEnabled = false
}...
重新运行构建,它通过没有任何问题! :)
关于ionic-framework - ionic : Execution failed for task ':mergeDebugResources' (Some file crunching failed),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38545711/