Ionic:任务执行失败':mergeDebugResources'(某些文件处理失败) [英] Ionic: Execution failed for task ':mergeDebugResources' (Some file crunching failed)

查看:123
本文介绍了Ionic:任务执行失败':mergeDebugResources'(某些文件处理失败)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ionic build命令工作正常,直到我决定添加一些自定义初始屏幕并运行以下命令,

Ionic build command was working fine until I decided to add some custom splash screen and run the following command,


离子资源

ionic resources

发布每次运行build命令时,运行build命令时出现以下错误,

Post that every time I run build command, I got below error while running build command,


:mergeDebugResourcesAAPT err(Facade for 35126910):libpng错误:读取
错误失败

:mergeDebugResourcesAAPT err(Facade for 35126910): libpng error: Read Error FAILED

失败:构建失败出现异常。

FAILURE: Build failed with an exception.

出了什么问题:

任务'执行失败':mergeDebugResources'。

Execution failed for task ':mergeDebugResources'.


某些文件处理失败,请参阅日志了解详情

Some file crunching failed, see logs for details

尝试:

建立失败

很明显,离子资源命令创建了一些问题。

So clearly, ionic resources command created some issues.

请帮助!

推荐答案

在浏览多个在线资源后,我发现离子资源处理/优化结果PNG文件。
发布当你运行 ionic build android 命令时,Android构建本身会尝试处理已处理/优化的Splash屏幕,但它不能很好地运行它报告错误。

After going through multiple online resources, I found that ionic resources processes/optimizes the resultant PNG files. Post that, when you run ionic build android command, Android build itself tries to work on already processed/optimized Splash screens but it doesn't work well and it reports an error.

因此,解决方法是告诉Android Build根本不要触摸那些PNG文件并继续提供它。怎么做?

So, the fix is to tell Android Build not to touch those PNG files at all and go ahead with what it is given. How to do that?

platforms \ android \中输入 cruncherEnabled = false build.gradle 文件如下,

Put cruncherEnabled = false in platforms\android\build.gradle file as below,


android {

android {

aaptOptions {

cruncherEnabled = false

}

aaptOptions {
cruncherEnabled = false
}

...

重新运行构建,它没有任何问题! :)

Re-run the build and it goes through without any problem! :)

这篇关于Ionic:任务执行失败':mergeDebugResources'(某些文件处理失败)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆