9-patch image error in Android 9-patch image error in Android android android

9-patch image error in Android


I have encountered with same problem on Android Studio:

AAPT out(943142208) : No Delegate set : lost message:DoneAAPT err(943142208): ERROR: 9-patch image /Users/cartman/Github/UteacherAndroid/RefactorDemo/app/src/main/res/drawable-xxhdpi/nav_shabow.9.png malformed.AAPT err(943142208):        Frame pixels must be either solid or transparent (not intermediate alphas).AAPT err(943142208):        Found at pixel #1 along left edge.

This is how I resolved it: Open draw9patch tool under your Android Sdk directory

cd /Android/sdk/tools./draw9patch

Open .9 png and save it again. Hope it helps.


This is the problem with the latest ADT that is 20.0.3. You can instead rename the *.9.png to *.png and start working.

I think this is the bug with the ADT only, since for 18.0.0 version ADT it doesn't prompt for this type of error and works fine.


The resource compiler strips 9-patches one-pixel borders away (and presumably stores the information gained from them in a more efficient way outside of the .9.png file). If you've fished these .9.png files out of an .apk, you'll need to add the border back by hand.