Changed resource image with another, recompiled, but the old image still appears - android

Did anyone face such a situation: you change a resource image with another image of the same name (for ex, btn.png with other btn.png), you then recompile the project and load the app into a mobile phone or emulator, but the old image still appears?
I do not know how to solve this issue. I tried uninstalling the app from the device, and installing the changed one, but new image still does not appear.
I know that I can choose a new filename and it will work, but how to force resource rebuilding?
PS. I realized that you can rebuild the project manually, so if anyone has a better solution (and faster), please let me know.

Unfortunately, it seems that in case when you replace one image with another of the same name, you have to rebuild the project as it will only trigger resources rebuilt.
I've tested different ways, and project rebuild was the only command which remapped PNG files in the resources folders.

I had faced this problem.Try doing all these this
1.Checkout all the resource folders and make sure the earlier image does not exist in any of the folders.
2.Try checking the name of the new image and check weather is same as to that of the earlier ones.
3.Try uninstalling the app after clearing all the data from the emulator or phone. Hope making all these stuff sure will solve this problem.I got it ryt by doing all these.
4.Also try runing the project after clearing the bin and gen folder in your project
.

Make sure your image in the resource folder is replaced by new image . In that case it must show new image after you do a clean build.

Related

Android app is displaying an old image that was replaced

I am adding some icons from the drawables folder to a layout. I had an image that I replaced which got the same name as the old one. I have overridden the file, rebuilt the project and the Android Studio's graphical layout showed the new icon. However, when I ran the app, the old icon appeared. I went over all the drawables folders to see if there might be one with the old icon, but it was replaced in every folder. I also tried reinstalling the app and it's still showing the wrong icon.
Why won't the app show the correct icon?
May be due to some bug of Android Studio, Try it out it will work :
Delete .apk from local path manually (Path : \YourProjectFolder\app\build\outputs\apk\app-debug.apk)
then Rebuild Project and finally Run it.
Because of instant run feature,
Once your app is installed, Instant Run allows you to push code changes without building a new APK
new apk is not creating. Try after deleting apk file from path ...\apk\app-debug.apk
Then build and generate apk again.
Rebuild Your Project then it works fine
Delete your icon from the drawables folder, set another image in the application instead of the deleted one, run the application, close the application, add your image again in the drawables folder, add it on your control and run again. It should work now.
What eventually happened is that the images were replaced in a library module, while the app module also contained the old image. Since the app resources overrides the library's resources, the old image was shown.

Android Studio shows old Image Assets

When I overwrite an image asset in Android Studio, for example the default ic_launcher, the IDE keeps showing the old image - no matter what I do, the image is never refreshed in the IDE (the deployed app uses the correct one). After a while you are not sure which files you have already changed and which are to be changed. You can prepare a list and check the items, but it would be nice to see the actual files in the IDE.
Is there any way to force this incredibly buggy IDE to 'sync' the cached image resources with those actually chosen by the developer?
I am using Android Studio 1.1.
Cheers
Open your src/drawable folder and make sure that this ic_launcher is not in any folder of your drawable, it means that in your mdpi, hdpi, etc... folder is this icon, then you can delete it in each folder on your drawable or you can replace it with yours (with the same name, if you don't want to replace the ic_launcher on the whole code), and Clean / rebuild the project.

Replaced image in Android project, but won't update in the app

I have an Android project, and I wanted to replace two of the images I use in it with updated ones. So, with Eclipse i just delete the old one and replace it with new one with same name. Then i refresh the project.When i see this in drawable folder it was replaced but when i run this project it was still showing old image in my app.
Please let me know the solution.This is very urgent.
First make sure you have replaced the image(s) in all drawable-* folders. If that is the case, doing Project->Clean (and selecting your project) in Eclipse after the refresh of the project files should do the trick. Also, before re-deploying on the device, uninstall the previous version of the app.

Android Setting Background

I'm trying to change the background of my first app to a png I have. I put the png in a newly created folder called "drawable." When I go to browse my "drawable" I can't see it's "children" or files. The only error of sorts that it gives me is "You must... rce item" anyone run into this? Android API 7 by the way.
Put the png in /res/drawable and then do a clean on your project in eclipse to force the .R class for your app to be recreated. You might also need to do an f5/refresh in eclipse on the project to get it to see that you have added a file in filesystem to /res/drawable.

Logo in the Res folders doesn't get updated on new runs for Android

I'm encountering a problem which i cant find an answer online or in stackoverflow. It should be pretty simple but i cant solve it.
I've recently created a new bunch of launch icons which i've placed in the different folders of the RES directory and I tried to run my emulator but it doesn't get updated. It still runs the old images which I've replaced.
Is it because I forgot to clear any caches (is there is any in android sdk ?? ) or whats happening ?
Uninstall the app from your Android device/emulator, and then run from Eclipse.
This will ensure a fresh install of the app on your Android device/emulator.
Try this
Eclipse-->Project-->Clean
Then clean your project..
Hope it will help you.
Try replace your default image icon with your new icon, then right click on RES folder, and choose refresh.

Categories

Resources