Reputation: 27257
Am trying to add icons to a navigation drawer but somehow, I can't access resources in the res/drawable
folder.
This is the list of icons I have in my drawable-hdpi
folder:
But I can't access any of them using the correct method:
It says cannot resolve the symbol '@drawable/ic_action_user'
This is strange because I have another application open that uses the exact same method and it works fine there.I've tried invalidating cache and restarting Android Studio with no luck.
All I get are the icons in the drawable-v21
folder:
Upvotes: 0
Views: 1906
Reputation: 2878
You have created drawable-hdpi folder inside drawable.
You should move it to res folder
.
Upvotes: 3
Reputation: 75788
You need to put images in drawable
folder instead of drawable-v21
. Create below drawable
folder under res
.
drawable-ldpi
drawable-mdpi
drawable-hdpi
drawable-xhdpi
drawable-xxhdpi
Then Clean & Rebuild your Project . Hope this helps .
You can check #SO How to import set of icons into Android Studio project
Upvotes: 1
Reputation: 1700
Try to put your images in the main drawable directory (res/drawable).. Not in the sub one (res/drawable-hdpi)
Upvotes: 0
Reputation: 967
you might have set min sdk version to 21 in gradle, set it to below version or copy all drawables in drawables-hdpi
to drawables-v21
, as only drawables in drawables-v21
will be used in versions equal to and above 21
Upvotes: 0