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

Welcome back Gamemakerlab!

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

Sincerely We’ve had the same problem and around the web there are just a few clues about this issue, so we 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-

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