• 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.

is it safe to add code to build.gradle files in %AppData%\Roaming\GameMaker-Studio\Android\runner ?



in build.gradle, how do you add or modify code that is not in the dependencies?

i want to add the following directly before dependencies

repositories {mavenCentral()}
but the problem is i cannot figure out how to do so, in extensions properties they allow you to inject into gradle dependencies but i cant find a way to insert a line into any other part of the build.gradle, let alone one line above it.

does anyone have an idea how this might be possible? is there a way i could compile a game, modify a file, then recompile it again so that its in the correct position?

thank you.


ok i have found something but i do not know if its safe to play around with this


inside this folder are four build.gradle files, each in a folder respectively named "rootfiles", "extentsionfiles" and "projectfiles"?

are any of these files used as the template to create the build.gradle file from when you compile a game?

the build.gradle file in the rootfiles folder has a note in it at the top that says the following

// Top-level build file where you can add configuration options common to all sub-projects/modules.
i do not understand what this sentence means in this context and could use a tiny bit of reassurance,

if i attempt to modify this file to add the line of code in the post above will i end up breaking the build.gradle process?.

from the sounds of things the top level build file seems fairly important based on what i read in this page and i would rather try to inser this at the module level rather than the top level, would one of the build.gradle files among these three be the one im looking for?


thank you


GMC Elder
When GM does not support modding the part of the build process you need (via gradle dependencies) then just make a backup copy of the android folder and change things to your heart's content (I regularly have to change things in the runner Java code and the build gradle process files).

Very safe to do as long as you backup. If you can do it thru the IDE though do it that way.