My APK is coming out to around 19 MB. I have no pictures or sound files in my project and only one class. Looking through the directory of my project folder (which is about 50 MB), most of the size seems to be coming from the .git folder in my src folder, and the .git folder in my bin folder, but I am under the impression that the .git folder is not included in the final APK. Does anyone know what could be causing this large size? I have tried cleaning the project as well with no luck. I am not referencing any other libraries, and my only private library is Google AdMobs. I am also using ProGuard.
Asked
Active
Viewed 2,012 times
3
-
Are you using ProGuard? – Louis Wasserman May 20 '13 at 17:08
-
1Why is there a `.git` folder in your `bin` folder? – jlordo May 20 '13 at 17:08
-
@jlordo Not really sure - that's just the way it's always been for me. Is that not how it should be? – John Roberts May 20 '13 at 17:09
-
3Open your .apk as a zip file (rename a copy to .zip if you can't do so otherwise) and see what is taking up the space. – Chris Stratton May 20 '13 at 17:10
-
have you enabled proguard in release mode?? – Raghunandan May 20 '13 at 17:10
-
@ChrisStratton Let me take a look. – John Roberts May 20 '13 at 17:12
-
@ChrisStratton So, apparently, the .git folder does end up in the final APK. Most of the size is coming from com->.git->objects and com->.git->modules. I notice that modules contains only one folder called ActionBarSherlock, which I was using, but removed for the time being to see what my size would be without it, so I have no idea why it's there. – John Roberts May 20 '13 at 17:17
-
@JohnRoberts: I don't see a good reason for having the binaries in version control... – jlordo May 20 '13 at 17:20
-
@jlordo I don't really know what to do about it. My project folder is managed by Eclipse. – John Roberts May 20 '13 at 17:25
2 Answers
1
The best approach is to init your git repository on your project's root folder and not on the src folder. The project's root folder is the one where the AndroidManifest.xml is located!
The .git folder is where all the git version control files are stored and it gets bigger as the project is developed.

thiagolr
- 6,909
- 6
- 44
- 64
-
-
1It is not as easy as cut and paste. If you wish to maintain the version control you should do what is explained here: http://stackoverflow.com/questions/614229/can-i-move-the-git-directory-for-a-repo-to-its-parent-directory – thiagolr May 20 '13 at 18:23
-
Or you could start a new version control on the root folder and delete the existing one on the src folder (and you will lose the current version control). – thiagolr May 20 '13 at 18:24
-
What if I'm not using git at all for my project? I've only used Eclipse up to this point. Can I just get rid of it altogether? – John Roberts May 20 '13 at 18:26
-
-
0
Have a look at the Android Size Analyzer. Details on this page: reduce-apk-size

ciaranodc
- 398
- 4
- 16