-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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 exports with Use Gradle Build create larger outputs #78780
Comments
Are you building an AAB with the Gradle build? If so, it's expected to be larger as it contains binaries for all architectures (rather than a single architecture in the APK as you've probably configured in the Android export preset). |
How do you set up the custom template? The custom Release and Debug template fields are prebuilt APKs, and thus only used for APK export (not Gradle builds). For a custom Gradle build, you should reinstall the source template that you compiled yourself. I don't remember if there's an option for a custom source template in the preset or if you should unzip it manually in your project's |
APK v7 and v8 |
That page seems slightly outdated (or more like it lacks important information on the Gradle build source template). When you compiled from source, it should have generated Then you should remove any existing You can do that by unzipping it manually as |
|
To be sure, can you check which version of Godot you compiled from source? You mentioned using Godot 4.0.3.stable, so you need to make sure that the custom Android template that you compile is for that same version, otherwise it can lead to compilation errors like this. The error could also be something else of course, CC @m4gr3d who might have more insights. |
My Godot 4.0.3 |
`# Generated using https://godot-build-options-generator.github.io disable_3d = "yes" |
I encoutered the same problem. My source code version is 4.1.1.rc and I build android release template myself with and disable_3d=yes. the generated android_release.apk and android_source.zip are all around 30MB. |
today I export Android with Godot v4.1 and the file size is 38MB but when using gradle build it enables the size to go up to 121MB why size is so big? |
@BITQinDynasty I'm used this tweak, and it's shrink to 20.5mb (with custom android source). UPD: But, this crash the game, because of null pointer dereference. |
Adding Android: extractNativeLibs="true" has solved the problem, and I hope the default template can be added |
@DexterFstone Can you use the Android Studio apk analyser to check what the generated apk contains. |
solved |
Should we consider enabling this option by default @m4gr3d ? |
There are tradeoffs in doing so, notably slower app load time
https://developer.android.com/guide/topics/manifest/application-element#extractNativeLibs |
But now that the option is enabled in template, why is it not enabled in Gradle build? |
@scgm0 What's the |
The reason for it is that The minimum sdk we support is |
Godot version
4.0.3 stable
System information
Windows 10, OpenGL 3.3
Issue description
Hi
when I export my project, my export file is 100MB, after using a custom template my apk file becomes 30MB, but when use Gradle build it's become 100mb again, why? it is a bug or can not have both?
Steps to reproduce
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: