Reputation: 153
I am build a mobile app using the Corona SDK. When testing the code in Corona it all works fine however when I put it on my phone I get an error something like "a path in my computer\mainMenu.lua:147:attempt to index local 'shotgunIcon' (a nil value)" I can not figure it out because it works in Corona and the variable isnt a nil value.
local shotgunIcon = display.newImage("Sprites/ShotgunIcon.png")
local shotgunIconGroup = display.newGroup()
shotgunIcon.x = CONTENT_WIDTH /2
shotgunIcon.y = 300
shotgunIcon.name = "SHOTGUN"
shotgunIcon:addEventListener("tap", switchWeapon)
shotgunIconGroup:insert(shotgunIcon)
Also why would the error on my phone have a file path on my computer???
Upvotes: 0
Views: 69
Reputation: 29483
Android is based on Linux, which is case sensitive for filenames. But Corona is installed on Windows, which is not case sensitive for filenames.
Upvotes: 1
Reputation: 153
OMG I found it. Corona is not case sensitive with file names. The phone however is. My file was called "ShotGunIcon.png" not "ShotgunIcon.png"
Upvotes: 0