Title: android studio generates invalid 9 patch png
Tags: android;nine-patch
Question: I stuck on generating 9 patch png with android studio's tool.Here what I do:
Right click on png(progress.png) and select create 9 patch
Set its name to _progress.9.png
Mark stretchable areas(see screenshot)
rebuild the project
In the end I got gradle error:
Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
Cleaning project and invalidating cache doesn't help.Here how it looks like:
Is android studio can't generate valid 9 patches?


Here is another answer: Try to use Gradle Console to know what the issue is,
See ScreenShot
Comment for this answer: @undefined Please look at my pic again, the error details are in described at the `AAPT` part, search for that part at your `Gradle` console then use these details to solve your problem
Comment for this answer: here what I got in the gradle console:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Comment for this answer: there is no such section.Here what I see in the console:
https://dl.dropboxusercontent.com/u/68778662/gradle%20error.png
Comment for this answer: the problem was that I have to set stretchable regions explicitly from all 4 sides although in the spec its said:
` If the padding lines are not included, Android uses the left and top lines to define this drawable area.`

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2017:00:02/18/17', 'FavoriteCount': 0.0, 'PostTypeId': 1, 'Tags': '<android><nine-patch>', 'Title': 'android studio generates invalid 9 patch png', 'ViewCount': 895, 'id': 42319335, 'user_AboutMe': None, 'user_AccountId': 9321550.0, 'user_DisplayName': 'undefined', 'user_Reputation': 593.0, 'user_Views': 98.0, 'user_id': 6920141.0}}