且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Ionic:任务执行失败':mergeDebugResources'(某些文件处理失败)

更新时间:2023-09-15 09:58:58

在浏览多个在线资源后,我发现离子资源处理/优化结果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! :)