Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBahi Hussien
Courses Plus Student 13,128 Pointsandroid studio drawable files doesn't change after replacing.
android studio drawable files doesn't change after replacing. i have tried to clean, rebuild and invalid cache, but nothing worked.
5 Answers
Bahi Hussien
Courses Plus Student 13,128 PointsAndroid Studio drawable files doesn’t change
If you are using android studio and cannot change drawable files although you have replaced them in the res folder, then this post may help you. There different reasons for such problem. First, you may need to rebuild, clean and invalidated cache and restart. Some times android studio doesn’t update project’s paths immediately. to do so
1- go to android studio’s menu bar Build > Rebuild Project
2- go to android studio’s menu bar Build > Clean Project
3- got to android studio’s menu bar File > Invalidate Caches / Restart
Second, if the first solution didn’t work then the problem is caused by the projects configurations. Such error may happen after trying to rename your project, rename your package name or even if you are trying to change project’s location. To fix this problem
1- go to AndroidManifest.xml (app/src/main/AndroidManifest.xml) and be sure that your package name is updated correctly.
2- go to build.gradle (app/build.gradle) and be sure that your application id is updated correctly. If not fix your applications id and Synchronize your project from android studio’s menu File > Synchronize
W Joel Baker
1,012 PointsAt the top left corner of your project tree there is a drop down titled "Android" which means it will not show any "User" (you) added directories. From the drop down change it from "Android" to "Project" and the new drawable directories will appear. Worked for me.
Angus McNab
2,487 PointsSorted! Thought I'd have to use the mipmap folders but they're only recommended for icons, I think.
Guilherme Mendonca
3,064 PointsHello Bahi,
Try these steps, it worked for me in the first try.
- Close Android Studio
- Go to the location where your project is saved (ex.: C:\Users...\Documents\AndroidStudio\FunFacts)
- Go all the way until you get to the "res" folder (FunFacts\app\src\main\res)
- Unzip the icon file that you downloaded
- Enter each drawable folder and replace the old icon with the unziped icon
- Open AndroidStudio
Hope it helps!
Bahi Hussien
Courses Plus Student 13,128 PointsThank you (Guilherme Mendonca) very much for your help.
Harry James
14,780 PointsHello! Try right-clicking on the drawables directory and refreshing it and see if that works.
Also, is it just on previews that you can only see the old images or is it the same when using the app?
Bahi Hussien
Courses Plus Student 13,128 Pointsit didn't work on the preview nor on the real device.
Bahi Hussien
Courses Plus Student 13,128 PointsThank you (Harry James) very much for your help.
Gunjeet Hattar
14,483 PointsDid you try renaming the files and adding them back again?
Bahi Hussien
Courses Plus Student 13,128 PointsThank you (Gunjeet Hattar) very much for your help.
Phil Spelman
6,664 PointsPhil Spelman
6,664 PointsI had manually added folders to the drawable folder. These new folders and files appeared under the Project tab, but would not appear under the Android tab. I did all the suggested steps, and Invalidate and restart worked...AT FIRST...I could navigate to all the folders and images. However, I now had errors in the Design view and after about a minute Android Studio seemed to refresh, and the new files and folders in drawable are no longer visible!!!