Jenkins Gradle应用程序:mergeDebugResources无法打开PNG文件 [英] Jenkins Gradle app:mergeDebugResources Unable to open PNG file

查看:913
本文介绍了Jenkins Gradle应用程序:mergeDebugResources无法打开PNG文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我们可以从Android Studio和cmd构建Gradle。但这个问题只在Jenkins建设的时候才会出现。这个问题并没有出现在Mac Jenkins的安装程序中,而是在我的Windows安装程序中。

所以我阅读了这个问题,并且有人说要确保所有的都是PNG文件。实际上有超过500个文件在日志中出现错误。我不能那样做。即使我这样做,我也不明白只有Jenkins才会发出这个错误。以下是我的gradle设置。





:app: mergeBetaDebugResources

  AAPT:\\\ \C:\Windows\System32\config\systemprofile\ .android\build-cache\671e94b2d47b0ef7a24e43f8814a29b911cc4872\output\res\drawable-ldrtl-mdpi\abc_ic_ab_back_mtrl_am_alpha.png错误:无法打开PNG文件
AAPT:\\?\C: \Windows\System32\config\systemprofile\.android\build-cache\7dc509eb0db17265925a5800b67445547ef97697\output\res\drawable-hdpi\common_google_signin_btn_text_dark_disabled.9.png错误:无法打开PNG文件
AAPT:\\\ \C:\Windows\System32\config\systemprofile\.android\build-cache\671e94b2d47b0ef7a24e43f8814a29b 911cc4872\output\res\drawable-ldrtl-xxxhdpi\abc_ic_menu_copy_mtrl_am_alpha.png错误:无法打开PNG文件
错误:某文件运算失败,请查看日志以了解详情
:app:mergeBetaDebugResources FAILED


解决方案

这个错误是因为build-缓存。它使用默认的build-cache文件夹,这是一个很长的路径。您可以通过将android.enableBuildCache = false添加到您的gradle.properties或设置构建缓存路径来禁用构建缓存。请参阅 https://developer.android.com/studio/build/build-cache。 HTML


So am able gradle build from Android Studio and cmd. But this issue is only coming in Jenkins while building. This issue didn't come in Mac Jenkins setup, but is coming in my Windows setup.

So I read about this issue and people have said to make sure all are PNG files. There are actually more than 500 files which comes as error in logs. I can't do that. Even if I do that I don't understand how come only Jenkins is giving this error. Below is my gradle setting.

:app:mergeBetaDebugResources

AAPT: \\?\C:\Windows\System32\config\systemprofile\.android\build-cache\671e94b2d47b0ef7a24e43f8814a29b911cc4872\output\res\drawable-ldrtl-mdpi\abc_ic_ab_back_mtrl_am_alpha.png ERROR: Unable to open PNG file
AAPT: \\?\C:\Windows\System32\config\systemprofile\.android\build-cache\7dc509eb0db17265925a5800b67445547ef97697\output\res\drawable-hdpi\common_google_signin_btn_text_dark_disabled.9.png ERROR: Unable to open PNG file
AAPT: \\?\C:\Windows\System32\config\systemprofile\.android\build-cache\671e94b2d47b0ef7a24e43f8814a29b911cc4872\output\res\drawable-ldrtl-xxxhdpi\abc_ic_menu_copy_mtrl_am_alpha.png ERROR: Unable to open PNG file
Error: Some file crunching failed, see logs for details
:app:mergeBetaDebugResources FAILED

解决方案

This error is because of the new feature of build-cache. It is using the default build-cache folder which is a long path. You can disable build-cache by adding android.enableBuildCache=false to you gradle.properties or set the build-cache path. See https://developer.android.com/studio/build/build-cache.html

这篇关于Jenkins Gradle应用程序:mergeDebugResources无法打开PNG文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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