Reputation: 31
When building my application APK, the final APK is twice as big as my Eclipse project folder. I was perplexed as to why this was happening, I'd like to keep my app as small as possible.
I've recently had to recover my application source by extracting from a released APK, I found out why the APK is so big, I use about 30 audio samples, saved as ogg files in /res/raw/. When the APK is built, an additional /raw folder is created in the root of the APK, with a duplicate of all of my ogg files.
Is there a way to stop these files being duplicated, is Eclipse/ant telling me the files should be in a /raw folder in the root of my project, instead of /res/raw?
Upvotes: 3
Views: 1751
Reputation: 1277
what happened between normal apk structure and duplicated one
how to duplicate this issue, by using res folder as source folder (add to build path)
remove res folder from build path would do the job
Upvotes: 1
Reputation: 31
Okay this isn't an answer at all, I'm still no clearer on what was going wrong with my project.
I did however manage to stop the files being duplicated in my APK build, by copying all my res files out of my workspace, deleting the res folder from within Eclipse (deleting the files as well). Then finally recreating the entire res structure by hand and re-adding all the raw assets by drag dropping them into Eclipse.
Upvotes: 0
Reputation: 1006539
The APK file will contain a res/raw/
directory, containing the sole copy of your raw resources for that APK. Eclipse and Ant will not add a /raw
directory to your APK, at least not if you use a normal build process.
For example, you examine this sample project, you will find that the resulting APK file has one copy of the OGG raw resource, not two.
Upvotes: 1