Title: app:mergeDebugResources error in Android Studio after upgrade
Tags: android;android-studio;android-gradle-plugin;build.gradle;aapt
Question: I am getting a error on build/execution of the Android Studio project.
Error:
:app:mergeDebugResources FAILED Error:Execution failed for task
':app:mergeDebugResources'.
Some file crunching failed, see logs for details
I have gone through the post on SO and have done the following things to fix it, but I am still not able to get rid of the errors.
Clean Project.
Invalidate and Restart Android Studio.
I have upgraded the Gradle Version from 1.3.0 to 1.5.0.
I have also upgraded the buildToolsVersion '23.0.1'.
Few more Gradle traces for reference:
Information:Gradle tasks [clean, :app:generateDebugSources,
:app:generateDebugAndroidTestSources, :app:compileDebugSources,
:app:compileDebugAndroidTestSources] :app:clean :app:preBuild
UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72300Library
:app:prepareComAndroidSupportDesign2300Library
:app:prepareComAndroidSupportSupportV42300Library
:app:prepareComCrashlyticsSdkAndroidAnswers131Library
:app:prepareComCrashlyticsSdkAndroidBeta113Library
:app:prepareComCrashlyticsSdkAndroidCrashlytics251Library
:app:prepareComCrashlyticsSdkAndroidCrashlyticsCore234Library
:app:prepareComGithubClansFab155Library
:app:prepareComGithubPaolorotoloAppintro320Library
:app:prepareComGoogleAndroidGmsPlayServicesBase780Library
:app:prepareComGoogleAndroidGmsPlayServicesGcm780Library
:app:prepareIoFabricSdkAndroidFabric135Library
:app:prepareJpWasabeefBlurry101Library :app:prepareDebugDependencies
:app:compileDebugAidl :app:compileDebugRenderscript
:app:generateDebugBuildConfig :app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets :app:generateDebugResValues UP-TO-DATE
:app:processDebugGoogleServices :app:generateDebugResources
:app:mergeDebugResources
AAPT: ERROR: 9-patch image
/Users/v/app/src/main/res/drawable-xxxhdpi/btn_small_white_normal.9.png
malformed.
AAPT:        Found at pixel #21 along top edge. AAPT:
/Users/v/Documents/app/src/main/res/drawable-mdpi/ic_send_black_disabled_24dp.png:
libpng warning: iCCP: Not recognizing known sRGB profile that has been
edited :app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:mergeDebugResources'.
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
Comment: @Soham: I will let you know after trying it.

Comment: Check [this](http://stackoverflow.com/a/28981972/3967525).

Here is the accepted answer: I found the solution to this problem, it might be a temporary fix but it works for now.
This problem is generated because of problem with the 9 patch image.
Look at this line in the traces, its throwing error.
AAPT: ERROR: 9-patch image
/Users/v/app/src/main/res/drawable-xxxhdpi/btn_small_white_normal.9.png
malformed. AAPT: Found at pixel #21 along top edge.
I have fixed the error by renaming the asset and removing the .9 from the file name.
The 9 patch file is a malformed asset and Android Studio will not build until its fixed.
You can ask you designer to fix it for you.
Comment for this answer: This error is probably thrown because pixel 21 at the top edge of your nine patch file is not (completely) solid or (completely) transparent. This means you have a pixel with an intermediate alpha value at the edge and android does not know what to do (stretch or not) with those pixels.

Here is another answer: Had the same issue. Turns out 2 of my image files were corrupted and thus would not crunch. Removed them from Res->Drawable, and voila!

Here is another answer: The solution that works for me has been (lucky I copied the project before) ....open the project by "Import project(Eclipse ADT, Gradle,...)
I hope, even if is simple answer, this could help you or someone else.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 3, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2015:00:11/20/15', 'FavoriteCount': 3.0, 'PostTypeId': 1, 'Tags': '<android><android-studio><android-gradle-plugin><build.gradle><aapt>', 'Title': 'app:mergeDebugResources error in Android Studio after upgrade', 'ViewCount': 28168, 'id': 33824237, 'user_AboutMe': '<blockquote>\n  <p>setVisibility(View.GONE);</p>\n  \n  <h1>SOreadytohelp</h1>\n</blockquote>\n', 'user_AccountId': 6838833.0, 'user_DisplayName': 'lang_android', 'user_Reputation': 171.0, 'user_Views': 22.0, 'user_id': 5259867.0}}