How can I track down the cause of Android “found a

2020-08-09 06:11发布

During build of my android application I am getting the following error:

:app:mergeDev_testingDebugResources
error: found an invalid color.

I don't get any line of code or even which file it is having a problem with. I have a large number of outstanding changes (stupid me) which I don't want to roll back - but I'm totally stumped as to how to work out what is wrong.

标签: android
4条回答
Ridiculous、
2楼-- · 2020-08-09 06:55

At Android Studio launch Analyze -> Inspect code. Then resolve all errors

查看更多
SAY GOODBYE
3楼-- · 2020-08-09 07:13

For future reference - this error is what you get if you have added an image as a 9-pack and it isn't yet properly formatted with the black pixel borders. The error message could be far more helpful, i.e. actually saying which file the error occurs with would be nice, but the solution is just to go through all your 9 pack files in Android Studio and open then save each of them.

查看更多
女痞
4楼-- · 2020-08-09 07:13

Yes, the problem is in 9-path image. At least in my case. The problem was in black lines in the borders of image. It should be only black and transparent. Nothing else. In my case there was shadow from view with alpha. With photoshop I remove any color pixels of borders (except black lines)

查看更多
疯言疯语
5楼-- · 2020-08-09 07:16

First of all, check your layout directory in file explorer bcoz when you have made changes in the main layout file then you could have changed respective example: v-21 or v-13 layout file too. This error occurs when you apply some element property which is not supported by previous versions like v-21.

I hope I have given detail about this, if any explanations are needed plz let me know.

查看更多
登录 后发表回答