1

I have two 9.png images created with the generator Nine Patches. When I run the app Android Studio stops and say me that the images have an error on the pixel #394. What is the problem??

These are the images.

Purple Green

The error in the log:

Error:Execution failed for task ':app:mergeDebugResources'.
> Error: Failed to run command:
    C:\Program Files (x86)\Android\android-studio\sdk\build-tools\android-4.4.2\aapt.exe s -i D:\Users\McFly\AndroidStudioProjects\Syncro\app\src\main\res\drawable-xxhdpi\spinner_line.9.png -o D:\Users\McFly\AndroidStudioProjects\Syncro\app\build\res\all\debug\drawable-xxhdpi\spinner_line.9.png
Error Code:
    42
Output:
    ERROR: 9-patch image D:\Users\McFly\AndroidStudioProjects\Syncro\app\src\main\res\drawable-xxhdpi\spinner_line.9.png malformed.
           Frame pixels must be either solid or transparent (not intermediate alphas).
           Found at pixel #364 along top edge.
Víctor Martín
  • 3,352
  • 7
  • 48
  • 94

1 Answers1

-1

Rename the file to example.png rather than example.9.png. I had same issue in past and renaming helped me.

pratz9999
  • 539
  • 4
  • 20
  • The whole point is the png to be 9 patch. Removing the extension does not answer this question. – parohy Jun 29 '21 at 07:57
  • @pratz9999 is sugesting to remove the patch number, not the extension. Actually, this advice did help me. – pepan Apr 20 '22 at 07:55