Android: Troubleshooting

This article contains information to help you set up the Android export in GameMaker Studio 2. Each section covers a different potential issue and how to resolve it, but if you have an issue that cannot be resolved through this article, please contact support.

Before doing anything else, it is highly recommended that you switch off your device and your PC and then re-start them both. You'd be surprised how many problems can be resolved by a simple re-boot of your system! Once you have done that, you should also check that the USB cable you are using to connect your device to the PC is appropriate as there are many that will show connected on the ADB but which will not permit the transfer of data (ie: They are charge only). So if you test a GameMaker Studio 2 game on your device and the compile finishes and exits with no further debug message in the compiler window, this is definitely a sign that your cable may be at fault.

 

Enable Developer Mode and USB Debugging on the Device

Before you can get your device to connect and run games with GameMaker Studio, you must first have enabled Developer Mode, and then enabled USB Debugging. On Android 4.2 and higher, the Developer Mode screen is hidden by default, so to make it visible, go to Settings > About phone and tap the Build Number seven (7) times. Return to the previous screen to find Developer Options at the bottom. In the Developer options you can enable USB Debugging.

 

Connecting a Device (PC)

If you are having problems getting your device to be detected by your development computer or GameMaker Studio 2, you need to make sure that it is discoverable using ADB. Below explains how to go about this:

  • Connect your Android device to your PC via the data cable (USB)

  • The device drivers should be installed automatically at this stage (if they aren't already), but if they are not, then please refer to your device manufacturer's support information to locate and install the correct ADB drivers. It is very important you get ADB drivers, not the standard consumer ones.
  • Now test your phone driver to confirm if it's correct. This can be done in a couple of ways:

    - If you have already set up a PATH variable to point to ADB directly (see here), then simply Windows Key and R to open a new Run window and type "cmd" (no quotes) and hit enter, then type "adb devices"

    - Go to your Android install folder and then the "platform-tools" folder inside it (e.g. C:\android-sdk\platform-tools) and then hold down the shift key and then right-click in some empty space and choose "Open a command window here". In the new command window, type "adb devices" (without the quotes).

Once this has been done, GameMaker Studio 2 should be able to auto-detect the device in the Device Manager. 

 

Connecting a Device (Mac)

When you first connect your Android device to your Mac via USB, you will get a message on bothe the device and the Mac about file transfer protocols, and GameMaker Studio 2 will not be able to communicate with the device. To resolve this issue, download and install the Android File transfer app which you can get from the following link:

Android File Transfer App

Once you have installed the app on your Mac, follow these steps:

  • Open Android File Transfer.
  • Unlock your Android device.
  • With a USB cable, connect your device to your computer.
  • On your device, tap the "USB for..." notification.
  • Select Transfer files.
  • An Android File Transfer window will open on your Mac.

GameMaker Studio 2 should now be able to detect your device, and every time you connect it to the Mac from now on the Android File Transfer app will open automatically.

 

Set USB Storage

It has been reported that on some devices for them to work correctly you should set the USB Connection to permit the copying of files between the computer and the SD card by clicking on the button marked "Connect USB Storage". This may not be necessary but is worth testing should you be having problems.

 

Using Dropbox to Transfer Your Game

Another way to get your game onto your Android device without using the data cable is to use DropBox. Download their app from the Android Market and install it on your device, then save the game apk created by GameMaker:Studio to your DropBox account. Once that's done and your device is synced to the DropBox account, just run the apk from your device.

 

Using Logcat To Debug Your Game

If you want to monitor in-depth how your game runs on your target device, or if you want to pinpoint a crash or get more information about an error, then it's often useful to enable ADB debug output in the ADB log. To do that, follow these steps:

NOTEFrom here on the guide will use <drive> when talking about the root folder for the Android SDK installation, so remember to substitute your actual drive letter in the paths when copying.

  1. If it's not already enabled, turn on USB Debugging on your phone in its settings panel.

  2. Plug the phone in to your PC. If required, your phone will install its drivers. Allow any driver-related prompts during this process.

  3. Assuming the drivers installed okay, check Device Manager in your Windows control panel to see if any remaining issues are present.

  4. If you have any yellow warning symbols next to "Android device", "Android Phone", etc., or something that references the model name of your device it's likely you're missing the ADB driver from the consumer driver package on the phone.

    1. You can get the generic Google ADB driver from <drive>:\android-sdk\extras\google\usb_driver. To use this, right-click the device with the warning icon and say you want to update the driver, that you want to provide the driver manually/it's already on your machine, and then point it to the folder just mentioned and click okay. Windows should now update the driver.

    2. Check that the warning icon is gone from Device Manager. If not, you may need to get specific ADB drivers for your device. Try Googling "[phone model name] ADB driver" and it should point you in the right place. Try to obtain a copy of the drivers from the official manufacturer download page or at least a respectable developer community.

    If all is green in Device Manager you're okay to carry on. Close Device Manager.

  5. Now in control panel again, open System. Choose Advanced System Settings and switch to the Advanced tab. Click the Environment Variables button here. In the second box here ("System Variables"), scroll down a little to find the PATH variable. Select it, then click the Edit button. Press the End key on your keyboard to jump to the end of the text-box if you're not already there. Is there a ; at the end of the text already? No? Add one. Now add in <drive>:\android-sdk\platform-tools\ and then okay everything until you get back to Control Panel.

  6. Hold down your Windows key and then press R. This should open the Run dialogue. Type in "cmd" (no quotes) and press enter. A command prompt will open. Type in "adb devices" (remember the space, no quotes) and press enter. You should get some response from the adb server, probably to say the server isn't running and that it's starting it up, then an odd-looking code and possibly the name of your phone. As long as it has the code, the "name" is fine even if it seems odd.

  7. If it found a device you're all set up. Type "adb logcat" and you'll see a sudden rush of text. When this has caught up with itself you'll be looking at what the phone is doing right now. Do something on the phone and watch the log respond.

    1. If you got an error about Windows not being able to find ADB, then there was a mistake made in step 5. Check that you put the semicolon in before the new path to platform-tools and that you included the \ at the end. Try running "adb devices" again after checking the PATHS variable is correct.

    2. If ADB is okay, but it didn't find a device, check that you turned on USB debugging, etc., on the phone and your driver is okay in control panel. You may have additional security options which you will need to set on the phone, depending on the model of your device. If all else fails, try a reboot of your PC and phone. If a reboot fails to fix it, then possibly the Google ADB driver won't work for your phone and you will need to get the manufacturer specific one. Check step 6 again. In the event that you got any anti-virus/firewall prompts about talking to your phone at any point during this process, you will need to allow that communication.

  8. Now that it's all working, any time you want to log something: plug your phone in, Windows+R, "cmd", "adb logcat", and watch the screen.

 

Nothing Works!

If you have tried all of the above, you should go back to the start of this document and make sure that you have done everything as stated, and that your device meets the minimum requirements necessary. Revise and make sure that the IP address, the ports and all other information is correct within GameMaker Studio 2 and that your installation of the Android SDK is correct too. Take a moment to read the other troubleshooting tips too as it may be something a simple as out of date drivers that are the problem. If all else fails you can speak to other users about the issues on the GameMaker Community Forums, or open a ticket with the helpdesk.

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.