-
Notifications
You must be signed in to change notification settings - Fork 10
Android GMS2
GameMaker supports Android (which includes Amazon Fire devices and your games can be released on various manufacturer-specific stores, not just Google Play Store and Amazon).
Target Manager (near the top-right corner of GameMaker) contains two export options for this platform:
-
VM- slower in-game performance, but quick to build each time and supports debugger builds -
YYC- faster in-game performance, especially with logic-heavy games, but much slower to build each time and does not allow debugger builds
Regardless of the output that you select, you will need to add some extra build tools to your development computer before you can continue. In this article we give the required steps to set everything up.
Caution
You must always use the specific tools version(s) advised in this section and do not assume newer versions than we list here "will be even better", as using newer tools than GameMaker knows how to support might introduce build failures you would have easily avoided if you had followed this guide correctly.
Android Studio:
Android Studio "Koala Feature Drop 2024.1.2 (Patch 1)" (if required, you can use the Android Studio downloads archive to get this)
Inside Android Studio:
| Android SDK Tab Name | Packages You Need |
|---|---|
| SDK Platforms | * API 35's one item for "Android SDK Platform 35" (you don't need all the rest of the API 35 section) |
| SDK Tools | * "Android SDK Build-Tools 34.0.0" (Gradle 8.5 requires 34 and does not support 35) * "NDK 27.0.12077973" * "Android SDK Platform-Tools 35.0.2" or newer (if fresh-installing you will get 36 automatically) |
Do not install Android beta versions which have any "-rc" suffix.
Gradle Plugin:
Requires Gradle Plugin version 8.5 specifically.
Android's build tools should install this automatically for you the first time you do a build inside this version of GameMaker, but should you need to download it manually you can do so using the link above.
Java JDK:
Android Studio installs OpenJDK for you, so please don't install newer versions of Oracle's JDK "just because". Also, Oracle changed their licence for Java several years ago, such that you may legally need to pay them for any commercial app-development usage if you install that one.
Emulator support using AVD is entirely optional and requires quite a bit of disk space. We recommended you deselect this and save the space, as we only offer support for issues found when running on physical devices.
Choose where to install and whether you want shortcuts (GameMaker never requires you to use Android Studio for anything other than occasionally managing your SDK installation). Allow the installer to finish, and then Android Studio's configuration screen will appear.
If this is a new Android setup, then the first screen will (correctly) advise you no SDK installation can be found. Click "Next" and then you will be asked which components you want to install and where.
Caution
For the "Android SDK Location" value, Google's path names can get very long and go beyond Window's path length limit of 256 characters, which will cause your builds to fail. Always install as close to the root folder of your drive as possible AND do not use any whitespace.
-
Windows IDE Users: We recommend
C:\AndroidSDK\(but you can install to a different drive root if you wish)
-
Mac and Ubuntu IDE Users: We recommend
~/AndroidSDK/
Note that you cannot just edit the path via the text field - you have to click the little folder button on the right and navigate through to your desired location (creating the folder, if required).
Once you have set the shorter SDK install path, click Next, accept the components list and the licences for those components, and click Finish.
Finally, once your chosen components are downloaded and installed, Android Studio will then fully start up.
When Android Studio appears it may have an update notification already waiting. Ignore any update prompts, as we will install the packages we need as we go through this guide.
Click the SDK Manager option on the front screen to begin installing your tools:
Tick both of the checkboxes for Hide Obsolete Packages and Show Package Details - it's important you do this, as you do not need to download everything for an API to make it work with GameMaker and later on in this guide we will want to pick specific tools versions, which may not be the newest versions listed.
See the Required Tools Versions table for which specific packages you need to select now.
Android Studio's installer will likely have already selected the latest available non-Beta "Android SDK Build Tools" (which is fine, but ensure you also/instead have the one we said in the table above) and the latest available version of Android SDK Platform Tools (which is fine and you can't modify).
With that done, click the Apply button at the bottom of SDK Manager, confirm the changes, and then wait for the download process to finish.
You are now ready to go and set up GameMaker for Android development. You can close SDK Manager and indeed Android Studio, as these do not need to be running whilst you work in GameMaker.
Note that (apart from the NDK installation) if you did not install everything you require in SDK Manager, whenever you next attempt an Android build inside GameMaker, Android's own tools will try to "repair your install" by downloading the missing bits during the build process - this is fine, allow this!
The values you have chosen inside Game Options will affect which packages are downloaded.
Similarly, be aware by default Gradle will assume/require an internet connection and will perform an update check and download any required components you do not have installed at the start of each GameMaker project build. We would recommend you leave this enabled, but if required you can disable this within Android Studio: https://developer.android.com/studio/intro/studio-config#offline
Of course, if you have a firewall or you use your computer offline often and you start seeing projects fail to build, before you report any bugs make sure you have downloaded the correct versions of any missing components manually and checked if this fixed your issue.
Inside GameMaker, you now need to set your values in Preferences > Platform Settings > Android.
| Preference | What You Set It To |
|---|---|
| Android SDK Location | Specify wherever you installed your SDK within Android Studio. Assuming you did use the values we recommended earlier as your SDK installation path, this would mean something like: * Windows: C:\AndroidSDK\ * macOS: /Users/[your macOS username]/AndroidSDK/ If you chose a different install location earlier and now want to change this so yours matches our recommendations, or you just need a reminder, you can do this back on the SDK Manager screen in Android Studio. |
| Android NDK Location | Android Studio always installs your NDK into a subfolder of the SDK install location, so use the file-picker button to find this folder now. Assuming you did use the values we recommended, this would mean something like: * Windows: C:\AndroidSDK\ndk[version number]\ * macOS: /Users/[your macOS username]/AndroidSDK/ndk/[version number]/ |
| Java JDK Location | Android Studio comes with its own version of OpenJDK, which is the only version of JDK Google's build tools actually supports, so use the file-picker button to find this folder now. The default paths Android Studio's installer recommends usually results in: * Windows: C:\Program Files\Android\Android Studio\jbr * macOS: /Applications/Android Studio.app/Contents/jbr/jdk/Contents/Home |
Scroll down and create your Keystore file next. This file is used to codesign all your Android apps, so please fill in all the details correctly and then back this file up along with a screenshot or other record of your username and passwords!
We recommend you create a single keystore file for your organisation and use this same file for all your projects, rather than generating separate keystores for each project.
When creating a new keystore file, you are required to give the following details:
| Preference | What You Set It To |
|---|---|
| File Name | The default text is where to find the file once it has been generated (change this value if you want to import your existing keystore file) |
| Password | The password you want to use for the keystore file itself, which must be at least six characters long |
| Alias | This is a single-word name of the "user" to add into this keystore |
| Alias Password | Needs to be the same password as the one above, as this is what Google's tools require |
| Common Name | This would normally be your own full name or some other identifier for you |
| Organisational Unit | The department within the company that you are in (Optional) |
| Organisation | The name of your company (Optional) |
| Location | The name of the town or city where you are based (Optional) |
| Country | The two letter code for the country where you are based (Optional) |
Note that all names must have only letters, numbers and spaces - no other "special" characters!
Once this information is filled in and you are happy with it, press the button marked Generate Keystore for GameMaker to create the necessary file. This may take a moment and then you should see the key hash fields are filled-in automatically. You can now Apply/OK and you're done.
If you have an existing Keystore file, point GameMaker at the file and fill in the details in the required list above exactly as they were when you first generated it.
Do not click the Generate Keystore button, as that would overwrite your file!
Instead, click the Show Key Hash button to confirm your user/password details work, then click Apply/OK to close Preferences.
Tip
The specification for a keystore file does allow you to have multiple users ("aliases") in a single keystore file. GameMaker doesn't provide for creating keystores in this fashion, but if you import a keystore which already has multiple aliases in it, then you just supply the master password and the details for the one alias you wish to use.
Inside Target Manager there is a column marked Devices and this has a small pencil button at the top. Clicking this button opens Device Manager on its Android page, where you can add your device(s) to deploy to when building your projects.
For GameMaker to detect your device it must be plugged into the computer using a USB cable and must have Developer Mode and USB Debugging enabled. On Mac you will also need to have installed the Android File Transfer App.
Important
Once "Developer Mode" and "USB Debugging" are enabled on your device, enable the "Install via USB" option as well while you're on the correct screen
Once the device is connected and unlocked for developer use, clicking the Detect Device button should automatically detect it and add it to the list of connected devices. Now ensure you click the Apply or OK button in Device Manager to save this new device.
With that done you can then click the Test Connection button, and if the Android device is visible and correctly connected via USB then it should say "Connection Successful!"
Tip
If you have any trouble with GameMaker finding your device(s), please see the Helpdesk article on Android Troubleshooting.
Before you can test your Android games you need to set some things in Game Options > Android, so open that now.
Here, GameMaker gives you a dropdown to selectively target a specific version of Android. For a project that has no extensions or extra requirements you would simply pick the newest API Level you have installed. (Note that this dropdown will show all APIs you have installed, so do pick carefully if you have installed more versions than just the one we said in the Required Tools Version table.)
Should you need to customise any of the other fields, always refer to what you have actually installed in Android Studio and get the version numbers from there; however, we will now briefly explain a few of these fields and their default values.
| Game Option | What You Set It To |
|---|---|
| Build Tools | If you chose API 30 or above in the top dropdown you will see this value is left blank because Google have changed this so you specify the Compile SDK value and the Android SDK works out the correct build tools you need. If you're compiling with API 30+, then any version you type here will be ignored by Google's tools, and if you are targeting an Android API below 30 then a suitable build tools value will be set for you by GameMaker. |
| Compile SDK | This is the version of the API that the project is compiled against. This means you can use Android API features included in that version of the API - e.g., if you try and use API 28 features in your game but only set Compile SDK to 26, then you will get a compilation error. Note that if you set a recent version you can usually still run the app on an older API device. |
| Target SDK | This actually has nothing to do with how your app is compiled or which API(s) you can utilise - instead, it indicates that you have tested your app on (up to and including) the version you specify. This is simply to give the Android OS an idea of how it should handle your app in terms of OS features. For all practical purposes, most apps are going to want to set Target SDK to the latest released version of the API (as used by the Compile SDK setting). This will ensure your app works as well as possible on the most recent Android devices. |
| Minimum SDK | The minimum API level that will run your project. The default value GameMaker sets will generally be fine, but if you add extensions, then they may require a higher minimum API level and so you would need to raise the value here. (Your build would fail with a suitable error message telling you that a certain number is required.) |
IMPORTANT! All apps for Google Play must be built with acceptable Target SDK and Minimum SDK values](https://developer.android.com/google/play/requirements/target-sdk)
You don't need to give any further information here while you are just testing your projects, so you can close Game Options now.
Once the above sections are completed and you have a project ready for testing, you can open Target Manager and select the Target, Output and Device options that you want to use. You can then click the Run button on the menubar to compile the project and push it to your test device.
If all goes well, you should soon see your game project running on your target device!
Tip
If any build ever fails, please read ALL of the Output Window log to determine why the build failed - do not only look at the two lines at the end, as you're missing the important information which will help you fix the issue right away!
When testing VM builds, you can also launch your game in the debugger by using the Debug button on GameMaker's menubar. The debugger allows you to see in detail how your game is performing, as well as set breakpoints and watch variables which will allow you to check for bugs in your code. For more information on how to use the debugger, see the manual by pressing F1 inside GameMaker or opening the Help menu.
Note that YYC builds do not support GameMaker's debugger - if you try to debug when YYC is selected in Target Manager then this will instead show a dialog saying GameMaker will do a VM build this time.
Be aware that running the debugger may require some extra permissions from the OS in terms of allowing firewall access, etc.
Once you have finished testing and are happy with the project, then you'll want to look at creating a final executable package and publishing it to a store; however, there are several steps you now need to perform before you make that package.
We will only cover the essentials here, but you can find complete information for each section of Android's Game Options from the GameMaker manual and we'd recommend reviewing everything before you submit each new game for the first time.
The product information values in Game Options > Android > General will be used to define how the product will be identified on the store being uploaded to, and you should give it a Display Name (which will be used on the Store and for the Icon name on Devices), a version number (always greater than any previous version you may have uploaded), as well as a unique Package Identifier.
The Package Identifier uniquely identifies your app on the device and in different stores. This ID is a reverse-URL format string in the style "com.companyname_.gamename", where the middle bit is usually your company/team name and is the same for all your store packages. For example: "com.gamemaker.windywoods" and "com.gamemaker.match3".
Important
If you want to upload a new version of your app, the application ID must be the same as the original package file you uploaded. If you change the application ID, the different stores will treat your next submission as a completely new app. So once you publish your app, you should never change the application ID.
With the architectures section in Game Options > Android > General you can select the CPU types you want the game to target. You may think the obvious choice is to select them all to get the widest coverage of devices; however, supporting each different target architecture adds to the size of your final package and so may be considered extra bulk for little gain - especially with bigger projects that may not run well on lower-end devices anyway, or on devices that are only popular in territories your game does not support.
Important
For submitting to Google Play you must have the Arm64 architecture enabled, otherwise, you will get an error when trying to review your uploaded .aab file that it does not support 64bit devices.
Game Options > Android > General has a few settings that you should review for the best performance for your players.
Screen Colour Depth: 24bit makes any gradients and glows much smoother and have less obvious "banding", but it comes with a cost as it will also impact on performance. Be aware choosing 24bit does not mean that your project won't run on a device with a 16-bit colour display; it will, but it may mean it's using extra resources for no gain.
Device Support: Do you want to target only devices with a dedicated GPU or all devices. Your choice depends entirely on your game's needs, but if it is using any surfaces, extended blend modes, 3D graphics, or is a large resolution project (like 1080p or higher) then you probably want to only support devices with a GPU.
Texture Page Size: Again, this depends on your own game's needs, but given how fragmented the Android market is you are probably better off choosing a smaller size than a larger size (if in doubt, simply leave it at 1024x1024). However, be aware choosing too small a size may impact performance as it can increase the texture swaps required, whereas too large a size may mean that your graphics get distorted on devices that have less VRAM (and so the texture is scaled down to fit in memory and then scaled back up to be drawn). Ideally, you should have a low-end and a high-end device to test your game with before submitting anything.
Still in Game Options, it's obviously important that you set the different promotional images that your game will use.
On the Icons and Images sections, each image should be authored as a PNG file and set to the size given. You can use the Tools menu's "Generate Project Images" tool to speed up creating your icons and splashes and setting them as used in Game Options.
On the Adaptive Icons section you have to supply a background and a foreground and then GameMaker will generate the various sizes for you. Note that the operating system on your player's devices will have some level of control over how the icons are actually displayed, so bear this in mind before placing important elements at the edges of your background/foreground.
In most cases, you should not have to change anything in Game Options > Android > Permissions because these should be set automatically for you when using GameMaker functions, but if you are using any third party extensions then you may have to select a permission manually. (See the documentation that comes with any extensions you're using in this project.)
In general, you want to only require what's absolutely necessary, as your player may be reluctant to install your game if they don't agree you need certain permissions.
If you plan on implementing this Google Play protection extension, review whether you have set your app correctly on the store and gotten your licensing key, then made sure this key is correctly added inside Game Options > Android > Packaging.
Once you have the Game Options correctly set up you are ready to compile your game as an APK for testing on your own developer-unlocked devices or as an AAB ("Android App Bundle") for uploading to a store.
You can compile the game using either VM or YYC, although we recommend that final executables always use YYC as, although it will take longer to build the project, it can give an important boost to in-game performance for your players.
Select the file type and the save folder, and then the compilation of your game will begin. You should note that the compile process may need to connect to the internet to download additional files and tools, which in turn may prompt a firewall alert - if this happens you should allow the connection otherwise the build will fail. After the game has finished compiling, GameMaker will open the folder containing the created package, ready for you to upload.
Once you have your package built you are ready to publish your game to any one of the numerous Android stores.
The main store is of course Google Play and Amazon is also very popular. Be aware that both of them require you to sign up as a developer and pay a joining fee beforehand. Once you've signed up, you will normally have to make an "App Listing", fill out some details and upload promotional assets, and then upload your game(s) for review by the store and eventually for releasing when all is ready.
You can find out more from the links below:
Both of them have their own documentation as to the current submission process and what they require your game to support (or, indeed, what your game must not do), so please do see your chosen store's own docs if you need guidance on actually submitting, private testing, their review processes, and what you need to do for managing your releases.