I have problem with my application, when I start it in simulator everything is okay, I can build it without errors too. But when I run corona debugger I got this:
Backtrace: \*[ 1] (nil) at main.lua:1
Everytime, even if main.lua is empty. When I build app and install on my device I got runtime error while launching:
main.lua:14: attempt to index local 'avatar' (a nil value)
Here is main.lua:
local licensing = require("licensing") licensing.init("google") local composer = require("composer") local function keylistener(event) if(event.phase == "up" and event.keyName == "back" and composer.getSceneName("current") ~= "menu") then composer.removeScene(composer.getSceneName("previous")) composer.gotoScene(composer.getSceneName("previous")) return true end end Runtime:addEventListener("key",keylistener) display.setStatusBar(display.HiddenStatusBar) local avatar = display.newImageRect("avatar.png",display.contentWidth / 3.5,display.contentHeight / 2) avatar.x = display.contentCenterX avatar.y = display.contentCenterY local signature = display.newImageRect("signature.png",display.contentWidth / 3,display.contentHeight / 2) signature.x = display.contentCenterX signature.y = display.contentCenterY + (display.contentWidth / 3) / 2 local function introlistener() display.remove(avatar) display.remove(signature) composer.gotoScene("menu") end timer.performWithDelay(3000,introlistener)
Every file is in same directory.