Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio - drawable folders are missing

I was trying to add some images to my project in Android Studio however I noticed that I only had the drawable folder, neither of other (drawable-hdpi etc.) folders were there.

So I decided to put them by hand, just created the folders with appropriate names and placed the images:

enter image description here

However It still kept giving this error which I couldn't handle. Why this error occurs and how to solve it?

Thank you.

like image 691
Burak. Avatar asked May 16 '15 07:05

Burak.


People also ask

Where is the drawable folder in Android Studio?

In Android Studio inside the res folder, one can find the drawable folder, layout folder, mipmap folder, values folder, etc. Among them, the drawable folder contains the different types of images used for the development of the application.

What is mipmap folder in Android Studio?

The mipmap folders are for placing your app/launcher icons (which are shown on the homescreen) in only. Any other drawable assets you use should be placed in the relevant drawable folders as before.


2 Answers

drawable-* folders should be under res and not under res/drawable.

like image 67
laalto Avatar answered Oct 16 '22 19:10

laalto


Different home screen launcher apps on different devices show app launcher icons at various resolutions. When app resource optimization techniques remove resources for unused screen densities, launcher icons can wind up looking fuzzy because the launcher app has to upscale a lower-resolution icon for display. To avoid these display issues, apps should use the mipmap/ resource folders for launcher icons. The Android system preserves these resources regardless of density stripping, and ensures that launcher apps can pick icons with the best resolution for display.

Make sure launcher apps show a high-resolution icon for your app by moving all densities of your launcher icons to density-specific res/mipmap/ folders (for example res/mipmap-mdpi/ and res/mipmap-xxxhdpi/). The mipmap/ folders replace the drawable/ folders for launcher icons. For xxhpdi launcher icons, be sure to add the higher resolution xxxhdpi versions of the icons to enhance the visual experience of the icons on higher resolution devices.

Note: Even if you build a single APK for all devices, it is still best practice to move your launcher icons to the mipmap/ folders. check here and here too.

like image 1
Devendra Singh Avatar answered Oct 16 '22 18:10

Devendra Singh