You’re passing a nil value as the first argument to pairs().
Check the variable you’re passing in to ensure it is pointing/referencing a table.
What are you doing when your app starts?
Are you reading a settings table or something like that?
You’re going to have to track this down on your own.
One thing you can do to get more info is to NOT remove debug.* from your builds. That way, you should get a more meaningful error message w/ a line number and filename.
Put this in build.settings:
settings = { .. other stuff build = { neverStripDebugInfo = true, }, .. other stuff }
I think you have this issue when the value you iterate is null or isn’t an array.
Use roaminggamer solution to find where exactly the problem come from. Or if you want to don’t push any update with the same issue, verify before each pair the value
So far I found out, that probably the problem happens in GGData (in the GGData:load function):
local data = {} local path = system.pathForFile( path .. "/" .. id .. ".box", baseDir or system.DocumentsDirectory ) local file = io.open( path, "r" ) if not file then return end data = json.decode( file:read( "\*a" ) ) io.close( file ) [...] -- Copy all the properties across. for k, v in pairs( data ) do box[k] = v end
The question would be, why the json.decode function returns nil (happens if the file is empty or does not contain valid JSON content), especially because it only happens on Android on only very rarely. The file to read is also generated by GGData.
I will have to try to get the content of this file from an affected user.
json.decode() returns nil as an indication that there was a problem. That’s your way of detecting errors. Of course, you’ve identified reasons why: invalid JSON, file doesn’t exist. You should test that file:read() actually returns something and not nil. You should also test if json.decode() returns a table or nil.
You’re passing a nil value as the first argument to pairs().
Check the variable you’re passing in to ensure it is pointing/referencing a table.
What are you doing when your app starts?
Are you reading a settings table or something like that?
You’re going to have to track this down on your own.
One thing you can do to get more info is to NOT remove debug.* from your builds. That way, you should get a more meaningful error message w/ a line number and filename.
Put this in build.settings:
settings = { .. other stuff build = { neverStripDebugInfo = true, }, .. other stuff }
I think you have this issue when the value you iterate is null or isn’t an array.
Use roaminggamer solution to find where exactly the problem come from. Or if you want to don’t push any update with the same issue, verify before each pair the value
So far I found out, that probably the problem happens in GGData (in the GGData:load function):
local data = {} local path = system.pathForFile( path .. "/" .. id .. ".box", baseDir or system.DocumentsDirectory ) local file = io.open( path, "r" ) if not file then return end data = json.decode( file:read( "\*a" ) ) io.close( file ) [...] -- Copy all the properties across. for k, v in pairs( data ) do box[k] = v end
The question would be, why the json.decode function returns nil (happens if the file is empty or does not contain valid JSON content), especially because it only happens on Android on only very rarely. The file to read is also generated by GGData.
I will have to try to get the content of this file from an affected user.
json.decode() returns nil as an indication that there was a problem. That’s your way of detecting errors. Of course, you’ve identified reasons why: invalid JSON, file doesn’t exist. You should test that file:read() actually returns something and not nil. You should also test if json.decode() returns a table or nil.