Game Maker Studio Tutorial – How to fix lint errors while building for Android

Hello there!

During these days a lot of fellow developers are asking me some hints for fixing their lint errors while exporting for Android using Game Maker Studio.

Sincerely I’ve had the same problem and around the web there are just a few clues about this issue, so I decided to write this simple tutorial, hoping it can be of help 🙂

So, yes, it’s a common issue, because lint is a new feature added to the Game Maker Studio build. If you are curious about lint itself and how to use it within your Android project, check this.

Ok. So, within your debug console you are getting something like this:

* What went wrong:
Execution failed for task ':com.companyname.applicationname'.
> Lint found errors in the project; aborting build.

Fix the issues identified by lint, or add the following to your build script to proceed with errors:
...
android {
    lintOptions {
        abortOnError false
    }
}
...

Eh, put like this, it is not giving us so many clues on how to fix it at all, right?
Don't worry just, scroll the debug console up a bit and you will find a great hint!
Check the screenshot:
2And what a great hint!
In fact, it is a link to a well detailed and formatted lint output file!
Here's what it looks like: 
3

As you can see there are a lot of warnings and messages, but once again, don’t worry since each one of them is a link to a very detailed explanation!

Let’s ignore the warnings and focus on the error which is making our build fail. It is obviously the one with the red mark 🙂

In this case it says: “NewApi: Calling new methods on older versions”. It is still not enough for fixing, but as I told you, just clicking on it will give us great detailed information:

4

Ah-ah! Got it!
It seems that one of the extensions my game is using “requires API level 11” but “current min is 9” meaning that while that extension is made for the Android API level 11 and above, Game Maker Studio is building using API level 9 as minimum target.

So yeah, easy fix in this case: under “Global Game Settings” select the “Android/Fire” tab and change the Min SDK from 9 to 11 (or above).

5

Finally, for a correct build, don’t forget to clean the target up and keep your Android SDK and NDK updated, as explained in the official post, here: http://help.yoyogames.com/hc/en-us/articles/216753498-GameMaker-Studio-Android-SDK-and-NDK-setup-

So, as ever, when having a problem, is always nice to log as much as possible and deeply investigate all the error logs and console messages! ^^

Well, thanks for reading!
I hope this little tutorial can be helpful to you!

Happy Coding! 😀

 

Comments

  • Hi,

    I have this errors:

    Class referenced in the manifest, com.yoyogames.FacebookActivity, was not found in the project or the libraries
    Class referenced in the manifest, com.facebook.LoginActivity, was not found in the project or the libraries

    Somebody knows how to solve?
    Thanks in advance

    JoseNovember 12, 2016
  • Thanks for reply.
    I have updated but nothing changes.
    It not works for me.

    JoseNovember 14, 2016
    • Well, at this point, since the Facebook extension is made by YoYoGames themselves, try to contact them with detailed information.

      Here’s the support center:
      http://help.yoyogames.com/hc/en-us

      And here you can open a new ticket:
      http://help.yoyogames.com/hc/en-us/requests/new

      I hope you can find a solution soon! 🙂
      Oh, when you do, please think about sharing the solution by updating your posts around the web (this one here, too, if you want) as reference for other developers, in case anyone else get stuck with similar issues, thanks!

      Mattia FortunatiNovember 14, 2016
  • I solved Changing the support library to 25 like the compile SDK
    Thanks for your help

    JoseNovember 17, 2016
    • Very nice! I’m happy to hear that! 🙂
      Yeah, it’s like a very common issue to get stuck with the SDK and min-SDK setup while working/building for Android with Game Maker Studio!
      Many thanks for keeping this page up to date with the solution to your issue!
      Cheers! 😀

      Mattia FortunatiNovember 18, 2016
  • Finally I can solve the problem within a week. Thank you for this guide. Hu hu … I’m really happy …

    erickAugust 17, 2017

Leave a Reply to Mattia Fortunati Cancel reply

%d bloggers like this: