-1

here is screenshot I have tried using latest gradle version and I also update latest android studio version to 2.2 , but following error occurring again and again while building the project, please suggest me.

Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]

Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:clean UP-TO-DATE
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2421Library
:app:prepareComAndroidSupportAppcompatV72421Library
:app:prepareComAndroidSupportSupportCompat2421Library
:app:prepareComAndroidSupportSupportCoreUi2421Library
:app:prepareComAndroidSupportSupportCoreUtils2421Library
:app:prepareComAndroidSupportSupportFragment2421Library
:app:prepareComAndroidSupportSupportMediaCompat2421Library
:app:prepareComAndroidSupportSupportV42421Library
:app:prepareComAndroidSupportSupportVectorDrawable2421Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\abc_ic_menu_selectall_mtrl_alpha.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\abc_list_selector_disabled_holo_light.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-mdpi-v4\abc_menu_hardkey_panel_mtrl_mult.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxxhdpi-v4\abc_spinner_mtrl_am_alpha.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxxhdpi-v4\abc_ic_star_half_black_36dp.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-hdpi-v4\abc_ic_star_black_36dp.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-hdpi-v4\abc_ic_commit_search_api_mtrl_alpha.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-mdpi-v4\abc_text_select_handle_middle_mtrl_dark.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xhdpi-v4\abc_text_select_handle_left_mtrl_light.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-ldrtl-hdpi-v17\abc_spinner_mtrl_am_alpha.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\abc_text_select_handle_left_mtrl_light.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-mdpi-v4\abc_list_pressed_holo_dark.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\abc_ic_star_half_black_36dp.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\abc_list_focused_holo.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\abc_btn_switch_to_on_mtrl_00001.9.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxxhdpi-v4\abc_ic_star_black_36dp.png ERROR: Unable to open PNG file
AAPT err(Facade for 445014223): D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xhdpi-v4\abc_ic_menu_copy_mtrl_am_alpha.png ERROR: Unable to open PNG file

Error: java.lang.RuntimeException: Some file crunching failed, see logs for details
:app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Error: java.lang.RuntimeException: Some file crunching failed, see logs for details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
vishraj
  • 1
  • 1
  • 2
  • Did u modified any images in drawble - extension from jpg to png? – Raghavendra Nov 22 '16 at 10:16
  • No code no answer,show your log please.And, did you try this?http://stackoverflow.com/questions/37131212/errorexecution-failed-for-task-appmergedebugresources-some-file-crunchin – Motee Nov 22 '16 at 10:19
  • Possible duplicate of [Execution failed for task 'app:mergeDebugResources' Crunching Cruncher....png failed](http://stackoverflow.com/questions/30764604/execution-failed-for-task-appmergedebugresources-crunching-cruncher-png-fa) – Raghavendra Nov 22 '16 at 10:27
  • The log saying "D:\projects\Intent2\app\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\abc_ic_menu_selectall_mtrl_alpha.png ERROR: Unable to open PNG file" check all those images – Raghavendra Nov 22 '16 at 10:29
  • no i didnt modify any image @Raghavendra – vishraj Nov 22 '16 at 10:33
  • @vishraj I think abc_ic_menu_selecta‌​ll_mtrl_alpha image is removed in latest sdk update. Did u refer those images in your app please comment those usages and try – Raghavendra Nov 22 '16 at 10:40
  • 1
    Problem solved , When I deleted these unnecessary png images from res folder from source, then it executes. thanks@Raghavendra. – vishraj Nov 22 '16 at 10:55

1 Answers1

0

This is due to adding an image in drawable which has some extension like(.jpg) and you have changed or saved that to a .png format(this error will occur while changing the image format manually without using a Editor tool). Android studio will throws a error while compiling the resource package using AAPT(Android Asset Packaging Tool), so all you need to do is use some Image Editor tools like "gimp or paint" to save the Extension accordingly. Rebuild your project once everything is done.

For example: open your image in Paint tool (drag and drop your Image to open it) -> File -> Save as-> save as Type-> select your required type from dropdown

Source: https://stackoverflow.com/a/34675557/842607

Community
  • 1
  • 1
Jimit Patel
  • 4,265
  • 2
  • 34
  • 58
  • U could post this link:) http://stackoverflow.com/questions/30764604/execution-failed-for-task-appmergedebugresources-crunching-cruncher-png-fa – Raghavendra Nov 22 '16 at 10:26
  • It didnt allowed me to just post link... but ya i can add source... wait will edit the answer – Jimit Patel Nov 22 '16 at 10:26