Skip to content
Search

Godot:Export:Android

lastmod 2023-04-05created 2020-11-0819 edits

Editor Settings

Godot-Editor-Settings.png

Export Android

Godot-Export-Android.png

Use Custom Build

If there are plugins, or if you need to add specific Java code, you need to do a custom build.

First, click Project > Install Android Build Template in the top menu:

Godot_-_install_android_build_template.png

Then click the "Install" button in the dialog that appears. It reads as follows:

  • This will set up your project for custom Android builds by installing the source template to "res://android/build".
  • You can then apply modifications and build your own custom APK on export (adding modules, changing the AndroidManifest.xml, etc.).
  • Note that in order to make custom builds instead of using pre-built APKs, the "Use Custom Build" option should be enabled in the Android export preset.
  • Sets up the project for custom Android builds by installing the source template to "res://android/build".
  • You can then apply modifications and build a custom APK on export (adding modules, changing AndroidManifest.xml, etc.).
  • To make custom builds instead of using pre-built APKs, you must enable the "Use Custom Build" option in the Android export preset.

Godot_-install_android_build_template-_confirm.png

When the installation is complete, an Android project (a template for building) is added at the res://android/build path. (It should be added to version control)

Add the required modules (plugins), and on "Android Export", click the "Use Custom Build" button.

Godot_-_android_export_with_use_custom_build.png

After that, go to Editor-> Editor Settings > Export > Android and set the Custom Build SDK Path.

Godot_-editor_settings-export-android-_custom_build_sdk_path.png

Troubleshooting

Unsupported class file major version 61

See Gradle#Unsupported class file major version 61.

Could not find keystore, unable to export

Go to Editor-> Editor Settings > Export > Android and check that all three pieces of keystore information—file path, user name, and password—are filled in correctly.

Godot_-editor_settings-_android_debug_keystore.png

'jarsigner' returned with error #1

Problems occur if the code signing information is wrong. Create the keystore file again with the keytool tool.

  1. keytool -genkey -v -keystore debug.keystore -alias debug -keyalg RSA -keysize 2048 -validity 10000
  2. goto Editor-> Editor Settings > Export > Android
  3. Debug keystore field: Point to keystore file in JDK folder.
  4. replace field "Debug keystore user:" to name that keysore.
  5. replace field "Debug keystore password:" password when you generate keystore.

See also

Favorite site

author Zer0 sitemap