GM:S 1.4 Can't compile for Android, no idea why

Discussion in 'Legacy GameMaker Community Tech Support' started by jujubs, Jun 30, 2018.

Tags:
  1. jujubs

    jujubs Member

    Joined:
    Aug 4, 2017
    Posts:
    67
    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.
     
    Amir2020 likes this.
  2. Jrtllion

    Jrtllion Member

    Joined:
    Oct 25, 2016
    Posts:
    21
    Did you configure your build tools, and support tools under globalgame settings -> android
     
  3. jujubs

    jujubs Member

    Joined:
    Aug 4, 2017
    Posts:
    67
    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
     
  4. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    3,525
    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.
     
  5. jujubs

    jujubs Member

    Joined:
    Aug 4, 2017
    Posts:
    67
    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?
     
  6. Jrtllion

    Jrtllion Member

    Joined:
    Oct 25, 2016
    Posts:
    21
    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.
     
  7. jujubs

    jujubs Member

    Joined:
    Aug 4, 2017
    Posts:
    67
    Everything sems ok there. Check it out:
    sdk.jpg
     
  8. bluberblaber

    bluberblaber Member

    Joined:
    Jun 8, 2018
    Posts:
    2
    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.
     
  9. jujubs

    jujubs Member

    Joined:
    Aug 4, 2017
    Posts:
    67
    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.
     
  10. issam

    issam Member

    Joined:
    Aug 5, 2016
    Posts:
    48
    For me I suffer from export to android just in the beginning, Its all about SDK for me!
     
    Amir2020 likes this.
  11. jujubs

    jujubs Member

    Joined:
    Aug 4, 2017
    Posts:
    67
    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: Jul 19, 2018
  12. Pavel Eremeev 18 18

    Pavel Eremeev 18 18 Member

    Joined:
    May 29, 2018
    Posts:
    1
    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: Dec 18, 2018
  13. Mert

    Mert Member

    Joined:
    Jul 20, 2016
    Posts:
    172
    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.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice