How to get android source of project before creating apk&signing to open it in Android Studio

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nikas

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?

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.

i_love_godot | 2019-12-11 15:24

:bust_in_silhouette: Reply From: andersmmg

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.

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

Nikas | 2019-12-12 03:07

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.

Calinou | 2019-12-12 10:45

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.

Nikas | 2019-12-12 14:10

:bust_in_silhouette: Reply From: Nikas

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.

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

shimozurdo | 2020-02-08 15:38