Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Export Bug: APK Package Size Increasing and Editor Crash with Audio Files #298

Closed
WizardLeaves opened this issue Dec 31, 2024 · 0 comments · Fixed by #299
Closed
Assignees
Labels
bug Something isn't working

Comments

@WizardLeaves
Copy link

I encountered while attempting to export my project for Android. When I tried to export a game project multiple times, I noticed that the size of the game's APK package was growing at an alarming rate, doubling in size each time. It started from 600MB, then grew to 1.3GB, and further to 2.9GB. Moreover, during the fourth export attempt, the editor crashed directly.

I then took steps to reproduce this issue. I found that when there were no audio resources (such as .ogg/.wav/.mp3) in the project directory, this problem didn't occur, and I could export the project multiple times without the editor crashing. However, once I added any audio file to the project, the size of the game's APK package would increase with each export, and it was guaranteed to crash during the fourth export. Specifically, the editor would flash back (close unexpectedly) after pressing the export project button.

I have also created a minimal reproducible example, and the steps are as follows:

  • Create a new game project and set up a Control scene as the root node.
  • Load the fmod-gdextension plugin in the addons, check it within the editor, install the default Android export template, and add the godot android plugin mentioned in the wiki.
  • Use Gradle for building, check the fmod plugin, and export in release.
    After testing, when exporting the game project multiple times with this setup and without adding an audio file, there were no issues, and the size of the game's APK package was 71.068KB.

After that, I added a base.ogg file (with a size of 104KB) to the project directory, and then the problem emerged.
During the first build, the APK package size was 71.068KB.
During the second build, the APK package size was 72,645KB.
During the third build, the APK package size was 74,310KB.
During the fourth build, the editor flashed back (crashed).

After the crash, I inspected the "res://android/build/assets" folder and discovered a recursive structure within its directory:
In the "res://android/build/assets/android/build/assets" path, the base.ogg file appeared.
In the "res://android/build/assets/android/build/assets/build/assets/" path, the base.ogg file appeared again.
In the "res://android/build/assets/android/build/assets/android/build/assets/android/build/assets" path, the base.ogg file was also present.

Furthermore, I checked the corresponding directories of the previously crashed projects and found that all audio resources in the project (such as .mp3/.ogg/.wav) were being repeatedly imported under the above paths. I suspect that this might be where the problem lies.

Godot Version: v4.3.stable.steam/v4.3.stable.mono
Plugin Version: 5.0.0-4.3.0

@piiertho piiertho added the bug Something isn't working label Dec 31, 2024
@piiertho piiertho self-assigned this Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants