I'm brand new to Android Studio and fairly new to development, so I might be missing something simple.
I am trying to import the ic_action_search.png from the Action Bar Icon pack. I've downloaded the Action bar Icon pack, selected the 4 directories containing the images (drawable-hdpi, drawable-mdpi, etc) and copied and pasted them into Android studio.
But in my menue_my.xml file I get a
Cannot resolve symbol error
at the line android:icon="@drawable/ic_action_search"
Here is a screenshot of my android studio with the xml file
I added the png's in project mode, and have tried build>clean and build>rebuild with no success.
When viewing the file structure in "Project" or "Packages" the drawable files appear to be there but not when the file structure is viewed from "Android". Also I don't seem to be able to paste the drawable files into the res folder while in viewing the file structure in "Android".
So the problem seems to have been with my file structure I was using
res/drawable/drawable-hdpi
res/drawable/drawable-mdpi
res/drawable/drawable-xhdpi
res/drawable/drawable-xxhdpi
where I should have been using
res/drawable-hdpi
res/drawable-mdpi
res/drawable-xhdpi
res/drawable-xxhdpi
so that the drawable directories for the various resolutions are siblings to res/drawable, NOT children.
Thanks to this answer https://stackoverflow.com/a/29294374/2779461
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With