Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Gradle app:mergeDebugResources Unable to open PNG file

Tags:

gradle

jenkins

I 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.

Below is my gradle setting.

enter image description here

: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
like image 472
Divyansh Singh Avatar asked Apr 28 '17 07:04

Divyansh Singh


2 Answers

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

like image 84
Ygor Duarte Avatar answered Sep 19 '22 11:09

Ygor Duarte


:app:generateReleaseResources those who encountered the error must add following line to gradle.properties after gradle3.x

android.enableBuildCache=false
android.enableAapt2=true
like image 38
mbakgun Avatar answered Sep 21 '22 11:09

mbakgun