Android : 9-Patch image Error
Asked Answered
B

1

0

i imported this keyboard app from git everything is working fine but i am getting this error while building project

Error:top-left corner pixel must be either opaque white or transparent.
Error:found an invalid color.
Error:top-left corner pixel must be either opaque white or transparent.
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for detail

can anyone tell me what is the problem please

Bijou answered 19/3, 2018 at 9:40 Comment(3)
Possible duplicate of Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for detailsDisbud
some time this is caused by long directory path.Windsail
@NoumanCh directory path mean? can you please tell me how to trace which image is causing this problemBijou
M
2

This error is caused by an incorrect/corrupted 9-patch file. They should have a transparent or opaque white border, but yours doesn't seem to have it. Try following the steps in this: https://developer.android.com/studio/write/draw9patch.html

Mistymisunderstand answered 19/3, 2018 at 12:2 Comment(3)
can you please tell me what is meant by border? top most pixels? please explainBijou
there are so many images in android studio can you please tell me how can i check in which images is this error?Bijou
Just above this error there should be the path of the image. If it's not there, try running with the --debug flag and checking in the full log.Mistymisunderstand

© 2022 - 2024 — McMap. All rights reserved.