我可以从Android Studio和cmd进行gradle构建。但是,此问题仅在构建时出现在Jenkins中。Mac Jenkins设置中未出现此问题,但Windows设置中已出现此问题。
以下是我的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 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
此错误是由于生成缓存的新功能所致。它使用的是默认构建缓存文件夹,该文件夹的路径很长。您可以通过在gradle.properties中添加android.enableBuildCache = false来禁用构建缓存或设置构建缓存路径。参见https://developer.android.com/studio/build/build-cache.html
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句