Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm developing a game using libgdx targetting Java desktop and Android. For the assets I have a "data" folder inside the "assets" folder in the Android project. Then, I link it from the desktop project.

My problem comes when I export, my .apk contains:

assets
com
lib
data
META-INF
res
AndroidManifest.xml
resources.arsc
classes.dex

This means my data files are duplicated in "assets/data" and "data" being the first one the only relevant one. This increases my APK size from 5 to 10MB which is kind of annoying. In my file system I only have the "assets/data" folder, no trace of the intruder there.

Does someone have any ideas why is this happening? How can I solve it?

PS: I've tried deleting the intruder manually opening the apk with 7zip but that destroys the checksum and prevents updates to be properly installed (needs complete reinstall).

share|improve this question
add comment

1 Answer

Finally I found the source of the problem. The Android project was linking against the desktop one to fetch the code and the libgdx libraries. I guess the APK exported saw that and simply copied the whole thing. This includes the link to the data folder in the desktop project, therefore the undesired duplicity.

Solution:

Just create a different project layout:

  • mygame: shared code and base libs.
  • mygame-desktop: desktop started, linked assets, desktop specific libs.
  • mygame-android: Android Activity, original assets, Android specific libs.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.