The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

+2 votes

How to works android export? As i think it unpack template android_debug(release).apk, filling sections, parameters, place there assets (from pck zip) and native libs and then pack it again in apk and signs.
Where is directory which godot make these export manipulations? Or export script which do it?

in Engine by (36 points)
edited by

I don't think you would be able to edit the code in Android Studio, because I doubt that your game code is converted into Java/Kotlin at any stage. Would be interested to know if that's true though. Hopefully someone with an understanding of that process can offer some insight.

2 Answers

0 votes

AFAIK the game is never compiled to Android code. The export templates all work by putting all the assets (including scripts) into a .pck file that can be used by the templates. The export templates just read the pck files to run the game, similar to how Unity executables work. If you want custom Android code in your app, you'll need to compile the export templates yourself.

by (654 points)

I don't need edit godot's code in android studio) And, of course, the game can't be convered to java)) But the android src's may be needed for customizing build result apk. For example, change build.gradle or create android app bundle (*.aab) to optimize size. For now I need put 2 platforms in one apk: arm64-v8a and armeabi-v7a - that make apk size x 2

But the Custom Build or compiling another android template isn't enough for creating aab, because the android template can't be opened in android studio to make ".aab" there.
I need filled or completed template for it, but android export doesn't produce it.

I see a way to fill the Custom Build template by "hands" putting into the template libs, parameters, godo pck in assets and change build.gradle and AndroidManifest.xml
or another way is to modify the GODOT_SRC/godot/platform/android/export/export.cpp which make filling the android template so it save resulting template after filing all sections and parameters

While more convenient, using AAB isn't a strict requirement to upload per-architecture APKs to Google Play. See Multiple APK support in the Android developer documentation.

I tryed upload 3 apk with different platforms: arm64-v8a, armeabi-v7a, x86 but Google Play don't publish it with a error about arm64-v8a requirement.
After several attempts, I came to the conclusion that it needed a platform arm64-v8a in each apk. So it seems multiple apk don't support anymore. Or i something done wrong.

0 votes

I found that GODOT_SRC/godot/platform/android/export/export.cpp transforms the android template to resulting apk. And it use godot cache directory for it: ~/.cache/godot but it makes all operations in memory and never save filled template on disk.

by (36 points)
edited by

Hi could you create the .aab file to upload play store?

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.