2

I am facing strange issue trying to put 9 patch drawables into new android studio mipmap directories. I've put all the images to specified folders, just as I used to do with drawable, but when I try to include it in a project it says

Cannot resolve symbol @mipmap/myfile

but it definitely "finds" it as you can see at the screenshot. the actual screenshot

I think it cannot resolve the symbol because the "real" filename has .9, but dots cannot be used in defining drawable. ( I tried, it didn't work :) )

Is someone esle is facing same problem? Currently, I've added the drawables folders and defined everything eclipse-style and it is working, but It is ugly way to resolve the problem. Thank you.

Evgeniy Mishustin
  • 3,343
  • 3
  • 42
  • 81

2 Answers2

6

You must add all your 9-patch images to drawable folder and use it by referencing @drawable/your_image_name.

For more information refer Android Developers Blog

Jaydipsinh Zala
  • 16,558
  • 7
  • 41
  • 45
1

Compilation and IDE resolution are 2 different things. Android studio can find your mipmap image but the android sdk does not support naming convention with 2 dots when you try to compile. Just rename your image to greenbuttonbg.png.

E-Kami
  • 2,529
  • 5
  • 30
  • 50