
Publisher
applovinmobileengine
AppLovinMAX
AppLovin MAX Godot plugin for Android and iOS.
This plugin has been mirrored from the Godot Asset Library.
The plugin author is in no way affiliated with Gadget.
If you are the author of this plugin and would like this mirror removed, please contact support@gadgetgodot.com.
AppLovin MAX Godot Plugin
AppLovin MAX Godot plugin for Android and iOS. We currently only support Godot 4.x.
Documentation
You may find our plugin on the Godot Asset Library.
We have an example scene Main.gd in /addons/applovin_max/Example/Scenes that shows an example integration of our APIs.
For information on how to use our plugin in your GDScripts, check out our integration docs here.
Plugin Integration Instructions
This section will provide the instructions on how to add the plugin to your Godot project and how to set up your Xcode and Android Studio projects.
Adding the Plugin
- Download the assets from the Godot Asset Library or directly from this repo with the
/addons,/ios,/androiddirectories. - In your Godot project, your
//res:directory should look like this:
Exporting/Building to iOS/Android
iOS
- In the Godot editor, open the
Exportwindow from theProjectmenu. When theExportwindow opens, clickAdd..and selectiOS.
- The
App Store Team IDand(Bundle) Identifieroptions in theApplicationcategory are required.
In the
Pluginscategory, theApp Lovin Maxcheckbox must be enabled.Click on
Export Project....
Note: You will see the export "fail" and see the error [Xcode Build]: Xcode project build failed, see editor log for details.
- This is an expected error, as the AppLovinSDK.framework is not included in the plugin by default. The reasoning behind this is to leverage Cocoapods to manage the iOS dependencies such as other ad network SDKs and our mediation adapters for them.
- We have future plans to help streamline this process.
- Once the project has exported, create a Podfile in the same directory as your Xcode project (
.xcodeproj). We have included an example Podfile in theExample-Xcode-Projectdirectory of the repo. Note: do not use the Podfile at the top-level directory as it is setup to build and use the plugin source files.
- To add other networks and their dependencies, please visit Preparing Mediated Networks. This tool will automatically generate the Podfile code.
- Note: Your Xcode project will not run by default as noted before until you run the next step.
- Finally, to install our AppLovinSDK and your dependencies, run the following on your command line tool:
pod install --repo-update
Other iOS Considerations
Tip:Removing the need to export repeatedly
Check out the Active development considerations section in Godot's Exporting for iOS doc.
This will allow you to make changes to your game code without having to export to Xcode again. You can simply make changes in Godot and run your build in your Xcode project immediately after.
- Note: The Godot iOS engine/framework uses different functions signatures depending on the target mode between release/debug. There may be incompatibility issues if the AppLovinMAXGodotPlugin.xcframework and exported Xcode project have mismatched release/debug versions. By default, Godot can differentiate between the AppLovinMAXGodotPlugin.release.xcframework and AppLovinMAXGodotPlugin.debug.xcframework when exporting to Xcode (target mode is controlled by the
Export with Debugoption).
Android
Requirement: please read Godot's Exporting for Android on how to setup your Godot project for Android.
In the Godot editor, click on
Install Android Build Template...from the Project menu. ClickInstall.In the Godot editor, open the
Exportwindow from theProjectmenu. When theExportwindow opens, clickAdd..and selectAndroid.In the
Pluginscategory,App Lovin Maxcheckbox must be enabled.Click on
Export Project...Open the Android Studio project. By default, it will be in
/android/buildfolder.
- Note: Your Android Studio project will not run properly by default.
- Godot can fail to export our plugin AAR to the Android Studio project. We will be using Gradle for dependency management. See Step 7 and onwards.
- As mentioned before, Godot can also fail to export your package name properly. See Other considerations.
- Copy the
AppLovin-MAX-Godot-Plugin.aarin/android/plugins/AppLovin-MAX-Godot-Pluginto thelibsdirectory in/android/build/libs. - In the
build.gradle, add the following line in thedependenciescode block:
implementation 'com.applovin:applovin-sdk:+'
- To add other networks and their dependencies, please visit Preparing Mediated Networks. This tool will automatically generate the gradle code.
- In the
AndroidManifest.xml, in the.GodotAppactivity entry, change theandroid:launchModeattribute value fromsingleInstancetosingleTask.
Repo Structure
This repo contains the following:
AppLovinMAX Godot Plugin
The root-level of this repo is structured to provide the official plugin and assets to Godot Asset Library:
- The Godot plugin source code is located in
addons/applovin_max. - The official Android Godot plugin
aarlibrary andgdapconfiguration file is located inandroid/plugins/AppLovin-MAX-Godot-Plugin - The official iOS Godot plugin
.alibrary and.gdipconfiguration file is located inios/plugins/AppLovin-MAX-Godot-Plugin
AppLovinMAX Godot Development and Example Project
The root-level of this repo contains a Godot Example project used to develop and export the Example project (with the AppLovin-MAX-Godot plugin) to Xcode and Android Studio. Files/Folders:
- project.godot, Open the project in the Godot IDE
- addons/applovin_max/, contains the official AppLovin-MAX-Godot plugin gdscripts.
- addons/applovin_max/Example, contains the Example project's main scene (
main.tscn) and source code (main.gd) - export_presets.cfg, Export Configuration file. Used for exporting to Xcode/Android Studio.
- For Xcode, the export path is already defined to 'Example-Xcode-Project/`.
- For Android, you must first install the Android Studio Build Template under the Project options which will create the Android Studio project in
android/build. Godot does not directly export to Android Studio; the export action essentially updates the build template project.
- android/build/, as noted above, this is the Android Studio project for the Godot Example project. You must first install the Android Studio Build Template under the Project options to generate the project.
- Example-Xcode-Project/, export in the Godot IDE to generate the Xcode Project for the Godot Example project.
iOS Plugin
The root-level and Source/iOS of this repo contains the Xcode workspace needed to build and develop the iOS AppLovin-MAX-Godot-Plugin.
- AppLovin-MAX-Godot.xcworkspace, workspace contains both the
AppLovin-MAX-Godot-Pluginxcodeproj and theExamplexcodeproj (if available/exported). - Podfile, run
pod installto add theAppLovinSDKdependency to workspace. This is where additional ad networks/adapters can be added to theExamplexcodeproj. Note: there are two Podfiles in the repo; one is the top-level and the other is in theExample-Xcode-Projectdirectory. The former is used to build the iOS plugin and Example project; the latter is used to build Example project as a standalone project. - Source/iOS/AppLovin-MAX-Godot-Plugin, contains the iOS plugin source code.
- Source/iOS/build, used by the
godot_plugin.pyscript to build the plugin.alibrary and its intermediaries. - Example-Xcode-Project, by default, this will use the official iOS plugin, but the dependency can be updated to use the local
AppLovin-MAX-Godot-Plugin.xcodeprojversion.
Android Plugin
The Source/Android of this repo contains Android Studio project needed to build and develop the Android AppLovin-MAX-Godot-Plugin.
- Source/Android, the Android Studio project contains the plugins source files and its
build.gradlereferences the necessary dependencies on thegodot-lib.aarand AppLovinSDKaar. Note: as of Godot 4.3, the latest Java supported is Java 17.
godot_plugin.py
This scripts standardizes the build and development process of the iOS and Android plugins. Please use Python 3.x to run the script.
Commands
python3 godot_plugin.py prepare_plugin_environment
Prepares the working space for iOS and Android development. Steps 2/4/5 prepares iOS; Step 3 prepares Android.
This command does the following:
- Cleans the working space and removes artifacts generated by previous builds or downloads.
- Downloads the
godot enginesource code using the given ``. - Downloads the official Godot Android library using the given ``.
- Generates the godot engine's iOS headers so the plugin may reference them.
- Runs
pod installfor AppLovin-MAX-Godot.xcworkspace and installs theAppLovinSDKdependency.
python3 godot_plugin.py build_ios
Builds the iOS plugin to ios/plugins/AppLovin-MAX-Godot-Plugin. Note: this builds both the debug and release versions of the .xcframework. Godot has different engine functions depending on the target mode. To be compatible with Godot debug/release Xcode project exports, the appropriate debug/release xcframework must be used; by default, the gdip is capable of selecting the correct version.
python3 godot_plugin.py build_android
Builds the Android plugin to android/plugins/AppLovin-MAX-Godot-Plugin
License
MIT