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

Android [FIXED] Fatal Error...STRING argument is unset - suddenly an issue, wasn't before

M

MADEWITHROBOTS

Guest
Hello, I have searched for an answer to this but I'm lost and so posting here in hopes someone can help.

My game is live on the Google Play Store, and has been functioning fine. However, after uploading an update, the game now crashes at launch on an Android device and gives the following error message:

######################################
FATAL ERROR in
action number 1
of Draw Event
for object oHighscore:

STRING argument is unset
######################################
---------------------------------------------------------------
called from - gml_Object_oHighscore_Draw_0
(line 6)

Everything was fine with previous versions of the app, all that changed between the versions was that I created a new object (unrelated to the one in the error message above) to handle signing in to Google Play Services. There are no errors when I run the game on my PC, I have been building and compiling in the same way each time and not had this error before. When the update went live and I saw this issue, I removed the new object, essentially returning the game to it's previous state. I submitted that as an update, but this error message is still appearing.

Here is the code for the object oHighscore - this is all of it, and it occurs in a Draw event:

draw_set_font(fHighScore)
draw_set_halign(fa_right)
draw_set_valign(fa_top)

draw_set_colour(c_dkgray)
draw_text((x+1),(y+1),"Hi-Score: " + string(global.Best))

draw_set_colour(c_white)
draw_text(x,y,"Hi-Score: " + string(global.Best))

As noted, there have been no issues with this code prior to the last couple of updates, and this code has been in the game since very early on. There are no issues running the game on my PC.

Also, the object oHighscore is not created until the 3rd room of the game, but this error is triggered from the game booting and it never gets to even load the first room.

In that 3rd room is also an object called oMenu, which has the following code in a Create event:

//Stop all sound
audio_stop_all()

//Read highscore from file
ini_open("highscore.ini");
global.Best = ini_read_real("Score", "Best", 0);
ini_close();

//Enter current highscore into highscore table
highscore_add(global.Best,global.Best)

audio_play_sound(aMenuMusic,1,true)

I am totally new to all this, having never coded anything before this project, so if I've omitted any useful information from this post please let me know. Hope someone can help, and thank you in advance.
 
M

MADEWITHROBOTS

Guest
EDIT - RESOLVED: I've fixed the issue, leaving this thread up so that anyone with a similar problem looking for help might find it. I did not find this answer in any of the threads I found while searching before posting here, but this worked for me and so could be valuable to someone else.

Since the error made no sense, and I couldn't find an answer from searching the error message, I was racking my brain trying to think of what I might have done differently during the compile compared to all other builds - I didn't use the 'Clean' function in GameMaker before compiling the build, in both of the builds that had errors.

It occurred to me that I hadn't done this simple step just on these occasions, and so it was worth a try. So I hit 'Clean', compiled the apk as usual, uploaded it, it's been published, I've downloaded it and it works, the error is gone.

Can't believe something so basic could completely break my game like that, but that's code I guess. Lesson learned. I didn't see any mention of using the 'Clean' function anywhere I looked when searching this error, so it bears repeating - always run a clean build when you compile for release!
 
Top