Gestures do not change after replacing others in folders

I created a new theme for my application and decided that I no longer needed the old one. So, I copied my new image files over the old ones, replacing them all. I have done this for all of my output folders. Then I recreated R.java just in case and rebuilt my application.

For some reason, it collects old images and displays them. Well, I thought there must be something in memory / cache. I just wipe the emulator image and try again.

After that, the application still used old photos. I thought I must have been mistaken and checked the images in Eclipse, but new images appeared there. Then I made serious decisions and deleted the output folders. Of course, this caused my interest in the project, so I quickly added the necessary new photos and rebuilt the project. No errors appeared, and all the images appeared in Eclipse.

But when the application started, old images were still showing. Except some parts of the application. Of the 70 or so images that I used, only 2 now displayed the new version. Everyone else is still showing old photos.

What can be done here? I tried to restart the emulator, update the project, create a new project using the old one as the source, restart my phone, erase all application data before installing the application, delete all images and replace them with new ones, but nothing seems to work.

How does an application that contains new images that run on a completely new emulator still display images that were deleted at least an hour earlier?

+7
source share
5 answers

Wipe the bin folder to remove the old compiled data.

+22
source

TL; DR: check your other drawable-xxxdpi folders for older versions too!

I had the same problem and none of the solutions here helped. It drove me crazy.

I replaced res / drawable-hdpi / file.jpg with file.png. It was a different extension and had different contents. Eclipse saw the new version, but no cleaning / updating, uninstalling the application or manually deleting bin / gen folders made the device see the new version.

Then I realized that I have other versions:

  • Res / Hood-ldpi / file.jpg
  • Res / Hood-MDPI / file.jpg
  • Res / extract-xhdpi / file.jpg

As soon as I replaced these versions with the modified versions of file.png, just restarting the application fixed the problem. It seems that the Android resource compiler saw the β€œjpg file” of the file first in another of the drop-down folders, and then ignored the subsequent version of β€œpng” in drawable-hdpi. Despite the fact that the device on which it was running was hdpi, it pushed out from another folder with tags.

+5
source

If checking other download folders for older versions and clearing the bin and gen folders does not work.

Look for: setImageResource(R.drawable.YourPNG) in your code that can override the drawable configured in xml from: res / layout / folder.

0
source

Android Studio: If Clean and Build do not work, try

Go to File > Invalidate Caches / Restart

or File > Synchronize

both worked for me.

0
source

A simpler solution is to remove the application from your emulator and then reinstall by running it again from Android Studio. (This will force everything to update)

This is always a strange problem, but I realized this by deleting the old images from my computer, but the old image will still be displayed in the application (which is impossible). Therefore, I decided that the problem was with the emulator. (since the emulator has its own storage)

If the file path and file names remain the same, I think Android does not update your application, even if the new image is different. Weird

0
source