This is a demo of how to create a custom android plugin.
Use this as a baseline for your plugins.
AndroidPlugin
- Android studio project that builds the pluginDemoLib
- The actual library to be built
GodotPlugin
- Files to necessary for Godot to recognise the pluginGodotProject
- Sample Godot project that shows how tot use plugin
- Replace
GodotAndroidPluginDemo\AndroidPlugin\godot-lib.release\godot-lib.release.aar
with the Godot engine library of your choosing- Download the Godot engine library
- Copy to the specified location
- Delete current
godot-lib.release.aar
- Rename the downloaded file to
godot-lib.release.aar
- Run
gradlew build
inGodotAndroidPluginDemo\AndroidPlugin
- Copy
GodotAndroidPluginDemo\AndroidPlugin\DemoLib\build\outputs\aar\DemoLib-release.aar
toGodotAndroidPluginDemo\GodotPlugin
- Rename
DemoLib-release.aar
toDemoPlugin.aar
- Copy both files from
GodotAndroidPluginDemo\GodotPlugin
toGodotAndroidPluginDemo\GodotProject\android\plugins
- Follow these steps to set up Godot to build for android
- Build the godot project and run
- Export
apk
and install on phone - Activate
developer mode
on android and enableUSB debugging
indeveloper options
- Export
- Open
GodotAndroidPluginDemo\AndroidPlugin
project in Android Studio - Modify
AndroidPlugin\DemoLib\AndroidManifest.xml
for requirements - Modify
AndroidPlugin\DemoLib\src\main\java\com\gd\android\demolib\InstantiateSingleton.java
for functionality
In GodotAndroidPluginDemo\AndroidPlugin\DemoLib\src\main\AndroidManifest.xml
change android:name
in the <meta-data\>
tag to point to the latest version (e.g. godotengine.plugin.v##.[Name]
)