0

I have a project i have worked on for a few weeks now. I went in to optimize some png's and was able to take a few mb's off the file size. However, when i generate the apk its the exact same file size.

I remember in eclipse i could go into the gen folder to delete those images and it would then recognize the new ones. I tried to go into the build folder in studio and do that but it still produces an apk the same file size. Is there something im missing?

I have taken one of the optimized images out of the produced apk and compared to the old and its the same size so its not picking up the new one for whatever reason.

Is there something else im supposed to do?

BigDX
  • 3,519
  • 5
  • 38
  • 52
  • isnt the compiler trimming the size of the images automatically? – bofredo Aug 15 '13 at 13:45
  • I thought about that but like i said. i compared a image taken out of the produced apk and it was larger than the one in the project i had optimized. maybe it does its own optimizations and thats just what im stuck with? – BigDX Aug 15 '13 at 14:42

5 Answers5

0

I know this is a very old thread but the answer to this question was never accepted.

So the problem here is in the emulator and not your computer or the software.

When you update the images the file names and paths stay the same. So it doesn't change the files on the emulator. I think it's just the way the android system works, if nothing changes then the app on the phone doesn't update.

So the solution is to simply uninstall the app from your emulator, then run the app from Android Studio.

k.serr
  • 13
  • 4
-1

Try rebuilding your app after refreshing the workspace, it works in eclipse but not sure about studio.

Chintan Trivedi
  • 748
  • 1
  • 8
  • 21
  • I have tried synchronizing the module and project. I'm thinking that is the same thing as refreshing? – BigDX Aug 15 '13 at 13:57
-1

Go to Project->Clean. Uncheck "Start a build immediately". Go right click on your project and choose build. Then Run as - Android Application.

In IntellijIdea :

http://www.jetbrains.com/idea/webhelp/cleaning-system-cache.html

How to clean project cache in Intellij idea like Eclipse's clean?

Community
  • 1
  • 1
  • I don't see a Clean option. There is no project file menu option and when i right click project i see no clean option – BigDX Aug 15 '13 at 14:07
  • I mean Project menu on Top. Not the project in fileexplorer. –  Aug 15 '13 at 14:09
  • [link](https://dl.dropboxusercontent.com/u/5012364/studio%20menu.png) I have no project in menu on top. Thats what i meant – BigDX Aug 15 '13 at 14:40
  • I did that and produced apk is still the same size. I guess that studio is doing all the optimizations is can when building – BigDX Aug 15 '13 at 16:56
  • Try to remove images, and build project. After - add images, and build him again. I never beleive that Idea can't manually refresh R file. Google it however. –  Aug 16 '13 at 07:38
-1

For me it works to choose Build -> Rebuild Project on the main menu to do a full rebuild whenever I only change assets (i.e. when no source code has changed).

free3dom
  • 18,729
  • 7
  • 52
  • 51
-1

Click Refresh Button

On top panel of xml designer there is Refresh Button.

Vijay
  • 2,021
  • 4
  • 24
  • 33