Error running on iOS, simulator works fine, problem with global variable table

Hi All,

I am getting an error when running my compiled corona code on iOS (post compiling and loading via Xcode)

My certificates are all working fine. The problem seems to be my usage of a global variables table and possibly composer… or it could be a very simple error on my behalf.

The code runs fine on simulator. I was wondering if its a typo somewhere but i am pretty sure i am using the right spellings/case everywhere

I have tried…

  • checking my capitalisation

  • moving around my declarations

  • recompling

Any help would be greatly appreciated

cheers

Nick

heres the error that the iphone configuration utility spits out

Nov 17 22:15:31 Phone wifid[15] \<Error\>: WiFi:[437915731.357004]: Enable WoW requested by "apsd" Nov 17 22:15:39 Phone game[2523] \<Warning\>: Runtime error module 'utils.myGlobal' not found:resource (utils.myGlobal.lu) does not exist in archive no field package.preload['utils.myGlobal'] no file '/var/mobile/Applications/D5B3350C-9763-4EF7-9DE6-F223AABCA9EE/game.app/utils.myGlobal.lua' no file '/var/mobile/Applications/D5B3350C-9763-4EF7-9DE6-F223AABCA9EE/game.app/utils.myGlobal.lua' no file './utils.myGlobal.so' no file '/var/mobile/Applications/D5B3350C-9763-4EF7-9DE6-F223AABCA9EE/game.app/utils.myGlobal.so' no file './utils.so' no file '/var/mobile/Applications/D5B3350C-9763-4EF7-9DE6-F223AABCA9EE/game.app/utils.so'utils.myGlobal stack traceback: [C]: in function 'error' ?: in function 'gotoScene' /Users/nick/\_Development/\_Projects/Game/code/screens/MainMenuScene.lua:93: in function \</Users/nick/\_Development/\_Projects/Game/code/screens/MainMenuScene.lua:87\> ?: in function \<?:221\>

heres my code

[lua]

–main.lua

–#########

local G = require(“utils.MyGlobal” ) – global values

local composer = require( “composer” )


– Game Analytics for Corona SDK: Composer example 


– local GA = require ( “plugin.gameanalytics” )

– Hide the status Bar

display.setStatusBar( display.HiddenStatusBar )

local function setupGlobals()

print( “loading globals” )

  

G.centerX, G.centerY = display.contentCenterX , display.contentCenterY

G.oX, G.oY = math.abs(display.screenOriginX), math.abs(display.screenOriginY)

G.cW, G.cH = display.contentWidth, display.contentHeight

– G.mainGroup = display.newGroup()

– G.mainGroup.classType = “mainGroup”

– G.stage = display.getCurrentStage()

– places to spawn things before positioning the

    G.offscreenX = G.cW*2

    G.offscreenY = G.cH*2

— Underscore is a set of utility functions for dealing with 

– iterators, arrays, tables, and functions.

– _G._ = require “utils.underscore”

– Not sure if this is a good place to put font setup

G.font = {}

G.font.H1 = 40

G.font.H2 = 30

    G.font.defaultType = native.systemFont

end

– Main function

local function main()

setupGlobals()

composer.gotoScene( “screens.MainMenuScene” )

end

end

main()

[/lua]

[lua]

–MyGlobal.lua

–#############

– usage: place local G = require(“MyGlobal”) at the top of each package

local M = {}

return M

[/lua]

The stack trace suggests that somewhere in your code, you wrote require(“utils. m yGlobal”) instead of require(“utils. M yGlobal”)

Also double check that your folder is named u tils, not U tils.

_memo you’re a star!

I didn’t notice/understand that the spelling in the error message would be case sensitive…and point me to a definitive solution.

A quick search and replace on ‘myGlobal/MyGlobal’ has solved the problem. I have checked the folder name and that seems to be ok.

Really appreciate the quick help.

The stack trace suggests that somewhere in your code, you wrote require(“utils. m yGlobal”) instead of require(“utils. M yGlobal”)

Also double check that your folder is named u tils, not U tils.

_memo you’re a star!

I didn’t notice/understand that the spelling in the error message would be case sensitive…and point me to a definitive solution.

A quick search and replace on ‘myGlobal/MyGlobal’ has solved the problem. I have checked the folder name and that seems to be ok.

Really appreciate the quick help.