This is my first time trying to package my libgdx project into .apk file and I get surprised that the file is 2 times larger than the total size of asset files. the assets folder supposed to be 4MB but the .apk file became 8MB.
I tried to check the source of the problem by extracting the .apk file. at first I thought it was the library file that cause the problem,
but then I checked that it only take 1MB of memory. Then I found out that the image and music folder inside asset folder are copied outside and that take double the size of the total size.
here is my android directory structure in eclipse project
-src
-gen
-asset
->image (30kB)
->musics (3MB)
->sfx (100kB)
-bin
-libs
-res
and here is the directory inside .apk file
-assets
->image (30kB)
->musics (3MB)
->sfx (100kB)
-com
-images (30kB)
-lib
-META-INF
-musics (3MB)
-res
-sfx (100kB)
is there anyone here ever had the same problem?
any solution about this?
thank you
Your assets get pulled in twice: once from the $ANDROID_PROJECT/assets directory, and once from the classpath of your desktop project.
Have 3 projects, shared code, desktop, android. The shared code project contains the actual application code, the desktop project contains a source folder link to the android/assets folder as well as the desktop starter class, the android project contains the assets and the android starter class.
You can also try to not export the assets source folder from your main project, that’s a bit more meh though.