Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

9patch image and Android Studio build failing

I have an interesting issue, and I dont know how to handle it. So, until now everything was fine, I was able to build my project. I just replaced an image with it`s 9patch version in three different sizes(mdpi, hdpi, xhdpi).

tw.setBackgroundResource(R.drawable.tag_rotate)

This is the line, where the building failing. It`s interesing, because the studio is able to show me the image on the left, and it is NOT marked as red. But the build is failing with the following message:

Error:(196, 52) error: cannot find symbol variable tag_rotate

UPDATE: if I remove the image from the code, and replace with a normal image, it works ! Im using the default 9patcher provided by SDK

like image 523
narancs Avatar asked Feb 10 '23 18:02

narancs


1 Answers

What kind of nine-patch generator do you use? I recomend you to use this generator. I tried to use standart android 9patch generator, which delivered with android SDK, and I had the problems with it.

like image 189
Aleksandr Avatar answered Feb 19 '23 23:02

Aleksandr