Attempt to index file 'topFrame' error in Steam uploaded version of Mac game

While I get no errors running the game directly from an actual corona build on my Mac, when I run the game that has been uploaded to Steam (either in the Steam console or running the steam game directly without Steam console), I get a weird “attempt to index field ‘topFrame’ (a nil value)” error, in a function createSc which does not even exist in my game.

I also tested by adding the actual corona build on my Mac (not the one built using steampipe) to the Steam console as a non-steam game, and that game does not have the error. So basically, only the Steam uploaded version of the game has this issue.

Note: I do not use or have not enabled Steam overlays anywhere in my game. Steam overlays is also switched off in my steam setting for the game.

The Windows version of the Steam game does not have this error when running it.

Has anyone come across this issue before? Does Steam add something to the game when building through steampipe that might be incompatible with corona on Macs?

Any help is much appreciated.

‘topFrame’ is a field name for an object reference in the Widget Library code found in all these files: 

  • widget_slider.lua
  • widget_momentumScrolling.lua
  • widget_scrollview.lua
  • widget_tableview.lua

and perhaps more.

I wonder if your theme selection code may be getting goofed up based on the platform and thus be unable to find an asset, which would result in topFrame object not being created and finally the field being ‘nil’.

You can find the source code for the widget library here: 

https://github.com/coronalabs/framework-widget

Appreciate you always helping other devs :) 

I don’t actually set any theme anywhere in the game. Is that something I need to do for Mac, and if so is it in build.settings or the config.lua file?

Below are the only things I have in my build.settings:

settings = { window = { defaultMode = "fullscreen", enableCloseButton = true, enableMinimizeButton = true, enableMaximizeButton = true, defaultViewWidth = 960, defaultViewHeight = 540, minViewWidth = 960, minViewHeight = 540, suspendWhenMinimized = true, --resizable = true, showWindowTitle = true, titleText = {default="Game Name"}, }, osx = { plist = { LSMinimumSystemVersion = '10.11.0', NSHumanReadableCopyright = "Copyright © 2013-2018" }, }, plugins = { ['plugin.mousecursor'] = {publisherId = 'com.spiralcodestudio'} } }

Where the error occurs I do have several scrollviews so as you mention it is definitely related to this I assume. So should I put those widget lua files in the folder that contains my main.lua? Appears strange to do this since the build directly built by corona works fine and only the one that has been uploaded through steampipe causes the errors. 

You need to get more debug output if you can.

If my guess is right, the log should show that ‘xyz’ asset was not found and thus some display object could not be made.

I believe you may be able to get more debug output by putting this in the settings table in build.settings:

settings = { ... your other stuff build = { neverStripDebugInfo = true, }, ... even more stuff }

You may also want to add an unhanded error listener to dump as much debug info as you can to the console:

https://docs.coronalabs.com/api/event/unhandledError/index.html

local unhandledErrorListener = function( event ) print( "We have a problem: " .. event.errorMessage ) for k,v in pairs( event ) do print(k,v) end end Runtime:addEventListener( "unhandledError", unhandledErrorListener )

This issue also makes me wonder if the images you need are getting stripped for some reason.

Be sure you’re not accidentally shooting yourself in the foot with the ‘exclude’ option in build.settings:

https://docs.coronalabs.com/guide/distribution/buildSettings/index.html#excluding-files

Note: I’m not a big user of the widget.* library, so I didn’t answer the ‘set a theme’ question, but you could try.

See the widget demo that comes w/ Corona simulator for how to do this.

Ummm, we don’t have any exclude code in build.settings, we use completely different sets of builds and files for each game version.

Will try and see if can get more debug info, but as mentioned the only one that is giving issues is the build that has been uploaded through steampipe, not the build directly created by corona on the Mac before uploading through steampipe.

I’m not familiar with steampipe (wish I were), but my hope here is you can get more debug log output from Corona.  

I strongly suspect that one of the image files you need is missing or inaccessible and thus the widget code is failing.

Actually I have it set up so that if an error occurs a closable pop up window appears with the bug info so players can post the bug. If the pop up window is closed in most case the game won’t function properly due to the bug, but with this error everything works fine when the window is closed as if there was no bug, so can’t be anything missing graphically. But will keep investigating, appreciate the previous feedback :slight_smile:

After checking scrollviews in more detail the bug is most likely due to an issue within the scrollview widget’s code OR something being removed by corona for desktop builds, as it for some reason can’t find something, which roaminggamer actually touched on in an earlier post. Although it’s still strange as we didn’t adjust or remove anything ourselves from the widget or widget images.

Switching to  hideScrollBar=true  on every scrollView, this crash no longer occurs.

This is of course not much use for those of you who use scroll bars but since we don’t use them it worked for us.

Note: It is also very odd that even for win32 desktop builds, all the widget_theme files (specifically still android names ones) are present in the resources folder.

‘topFrame’ is a field name for an object reference in the Widget Library code found in all these files: 

  • widget_slider.lua
  • widget_momentumScrolling.lua
  • widget_scrollview.lua
  • widget_tableview.lua

and perhaps more.

I wonder if your theme selection code may be getting goofed up based on the platform and thus be unable to find an asset, which would result in topFrame object not being created and finally the field being ‘nil’.

You can find the source code for the widget library here: 

https://github.com/coronalabs/framework-widget

Appreciate you always helping other devs :) 

I don’t actually set any theme anywhere in the game. Is that something I need to do for Mac, and if so is it in build.settings or the config.lua file?

Below are the only things I have in my build.settings:

settings = { window = { defaultMode = "fullscreen", enableCloseButton = true, enableMinimizeButton = true, enableMaximizeButton = true, defaultViewWidth = 960, defaultViewHeight = 540, minViewWidth = 960, minViewHeight = 540, suspendWhenMinimized = true, --resizable = true, showWindowTitle = true, titleText = {default="Game Name"}, }, osx = { plist = { LSMinimumSystemVersion = '10.11.0', NSHumanReadableCopyright = "Copyright © 2013-2018" }, }, plugins = { ['plugin.mousecursor'] = {publisherId = 'com.spiralcodestudio'} } }

Where the error occurs I do have several scrollviews so as you mention it is definitely related to this I assume. So should I put those widget lua files in the folder that contains my main.lua? Appears strange to do this since the build directly built by corona works fine and only the one that has been uploaded through steampipe causes the errors. 

You need to get more debug output if you can.

If my guess is right, the log should show that ‘xyz’ asset was not found and thus some display object could not be made.

I believe you may be able to get more debug output by putting this in the settings table in build.settings:

settings = { ... your other stuff build = { neverStripDebugInfo = true, }, ... even more stuff }

You may also want to add an unhanded error listener to dump as much debug info as you can to the console:

https://docs.coronalabs.com/api/event/unhandledError/index.html

local unhandledErrorListener = function( event ) print( "We have a problem: " .. event.errorMessage ) for k,v in pairs( event ) do print(k,v) end end Runtime:addEventListener( "unhandledError", unhandledErrorListener )

This issue also makes me wonder if the images you need are getting stripped for some reason.

Be sure you’re not accidentally shooting yourself in the foot with the ‘exclude’ option in build.settings:

https://docs.coronalabs.com/guide/distribution/buildSettings/index.html#excluding-files

Note: I’m not a big user of the widget.* library, so I didn’t answer the ‘set a theme’ question, but you could try.

See the widget demo that comes w/ Corona simulator for how to do this.

Ummm, we don’t have any exclude code in build.settings, we use completely different sets of builds and files for each game version.

Will try and see if can get more debug info, but as mentioned the only one that is giving issues is the build that has been uploaded through steampipe, not the build directly created by corona on the Mac before uploading through steampipe.

I’m not familiar with steampipe (wish I were), but my hope here is you can get more debug log output from Corona.  

I strongly suspect that one of the image files you need is missing or inaccessible and thus the widget code is failing.

Actually I have it set up so that if an error occurs a closable pop up window appears with the bug info so players can post the bug. If the pop up window is closed in most case the game won’t function properly due to the bug, but with this error everything works fine when the window is closed as if there was no bug, so can’t be anything missing graphically. But will keep investigating, appreciate the previous feedback :slight_smile:

After checking scrollviews in more detail the bug is most likely due to an issue within the scrollview widget’s code OR something being removed by corona for desktop builds, as it for some reason can’t find something, which roaminggamer actually touched on in an earlier post. Although it’s still strange as we didn’t adjust or remove anything ourselves from the widget or widget images.

Switching to  hideScrollBar=true  on every scrollView, this crash no longer occurs.

This is of course not much use for those of you who use scroll bars but since we don’t use them it worked for us.

Note: It is also very odd that even for win32 desktop builds, all the widget_theme files (specifically still android names ones) are present in the resources folder.