• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Legacy GM Can't compile for Android, no idea why

jujubs

Member
So I'm finally moving on to Android, after my Windows Phone gave up the ghost last week. I was very confused with the overly complex steps to get the damn thing working, but I think everything should be working by now. The SDK thing is running on admin mode and I was able to updates the SDK tools and such, and I'm sure my PC can see the phone, which also is already dev enabled and paired with the PC.

However, when I try to compile my game, this is what I get:
Code:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project ''.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:2.2.0+.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:2.2.0+.
         > Failed to list versions for com.android.tools.build:gradle.
            > Unable to load Maven meta-data from https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metadata.xml.
               > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metadata.xml'.
                  > Connection reset
      > Could not resolve com.android.tools.build:gradle:2.2.0+.
         > Failed to list versions for com.android.tools.build:gradle.
            > Unable to load Maven meta-data from https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml.
               > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml'.
                  > Received fatal alert: protocol_version
I was able to find one other topic where somebody had the same problem here, but the fella said he fixed it by turning on wifi. I only use my PC via wifi, so I'm really lost with what could be going on here.
 
J

Jrtllion

Guest
Did you configure your build tools, and support tools under globalgame settings -> android
 

jujubs

Member
Did you configure your build tools, and support tools under globalgame settings -> android
I guess so. That part wasn't actually covered in the tutorial, so I'm not sure about the numbers though. It looks like this, currently:
andraids.png
 

rIKmAN

Member
That's saying that it couldn't connect to download Maven, but this thread says the latest version comes with it, so maybe give that a try.

Try a wired rather than wireless connection before that though, see if that works.
 

jujubs

Member
That's saying that it couldn't connect to download Maven, but this thread says the latest version comes with it, so maybe give that a try.

Try a wired rather than wireless connection before that though, see if that works.
My internet connection is just fine, but I tried with the cable anyway and it gave out the same error.
Also, I'm on version 1.4.1804, which appears to have been released on 13/03/2018. Isn't it the latest?
 
J

Jrtllion

Guest
Unfortunately I'm not near a computer to lookup my values, but does your SDK / ndk & java check out under file-> properties? I set mine up a couple weeks ago after a hard drive crash and after much trying, I switched to the android studio install method rather that the SDK manager, which ultimately did work.
 

jujubs

Member
Unfortunately I'm not near a computer to lookup my values, but does your SDK / ndk & java check out under file-> properties? I set mine up a couple weeks ago after a hard drive crash and after much trying, I switched to the android studio install method rather that the SDK manager, which ultimately did work.
Everything sems ok there. Check it out:
sdk.jpg
 
B

bluberblaber

Guest
When I first tried using the Android module it took me 3 weeks to get it working. After receiving multiple errors, this is what I did: "What will it do in a new project?" It downloaded the required stuff. I don't understand why it didn't do that in that in the first place. I uninstalled the SDK, like 50 times. So basically, open new project, create a room and run the module. If it works for you, then you should be able to compile your existing project.
 

jujubs

Member
When I first tried using the Android module it took me 3 weeks to get it working. After receiving multiple errors, this is what I did: "What will it do in a new project?" It downloaded the required stuff. I don't understand why it didn't do that in that in the first place. I uninstalled the SDK, like 50 times. So basically, open new project, create a room and run the module. If it works for you, then you should be able to compile your existing project.
This is so frustrating. The error log is completely useless, so it all feels like waving hands in the dark until you hit something that makes it work :/

I already tried building a blank project with an empty room. The first time I saw a compiler error I was like "eh, my code must be broken", so I ignored the rest and did that. I tried it again now, to no avail.
 

jujubs

Member
So I got a new phone, which meant an upgrade from Android 4 to Android 7.1, which made me go through a fresh install. So after a brand new set of useless errors, I managed to get everything working, up to the point where I'm back on square one, as now I'm having the exact same error I had before. I even got a new broadband service, which means I can now access the internet when it's raining, too. So, what gives? Why can't GMS connect to the internet to download whatever Android needs even though I'm connected to the internet and have already filled my HDD with useless SDKs?

Edit: Managed to deploy from Android Studio to the phone, no problems at all. Still no luck with GMS 1.4.
 
Last edited:
P

Pavel Eremeev 18 18

Guest
Open file
%appdata%(AppData/Roaming) \ GameMaker-Studio\Android\runner\RootFiles\build.gradle
Change string
classpath 'com.android.tools.build:gradle:2.2.0+'
to
classpath 'com.android.tools.build:gradle:2.3.0'
This work for me, maybe GMS try find directory with name "2.2.0+", and ignore command 2.2.0+ and not find latest versions.

Also maybe you must change the grandle version
Open file AppData\Roaming\GameMaker-Studio\Android\runner\gradle\gradle\wrapper\gradle-wrapper.properties
Change version of grandle to
...distributions/gradle-3.3-all.zip
 
Last edited by a moderator:

Mert

Member
That's because Google has removed Gradle 2.2.0 from repositories which Game Maker Studio uses currently. Check this topic for help, that'll solve your issue.
 
Top