I've been trying to use this http://inloop.github.io/shadow4android/, but all the 9 patches it draws won't compile with Android studio. Anyone have a fix or an alternative? I'm trying to draw shadows.
AAPT: error: file failed to compile.
When I look at the 9 patch editor in Android Studio it doesn't show any bad patches.
I need to control the color of the shadow and I'm using a Cardview.
I generated a 9-patch on the site you mentioned. In Android Studio I see this error:
The following error is seen when running aapt directly:
Upon inspection in an image editor, it becomes clear that there is a pixel in the bottom of the image that has an alpha other than completely opaque or transparent as stated in the aapt error message. Deleting the offending pixel by making it 100% transparent solved the compile problem.
If this is the issue that you are seeing, inspect the borders of the 9-patch in an image editor of your choice (I use GIMP) and correct the offending pixel(s).