Simulator works like a charm, but I get Runtime error on Android device

Hello everybody! 

I’m new over here, I’ve got my hands on Corona SDK about 3 days ago and it blew my mind, I haven’t been so excited about programming for more than 10 years.

I’ve made great advancements so far, but while making a small test on how my app would run on my device, I got the attached error.

The app runs like a charm in the Simulator, no errors whatsoever, but when running on my device I get the error from the screenshot in a VERY SIMPLE line: sceneGroup:insert(fzLogo)

This is surely a newbie error, and yet I’ve read LOTS of guides and forum posts on the subject, I can’t find what it is, specially being a line so simple.

I’m copying the whole content of the lua file, since it’s very short.

Help please, so I can move forward!

local composer = require( "composer" ) local scene = composer.newScene() local function nextScene() composer.gotoScene("MAINMENU", {effect = "fade", time = 1500}) end -- ----------------------------------------------------------------------------------- -- Code outside of the scene event functions below will only be executed ONCE unless -- the scene is removed entirely (not recycled) via "composer.removeScene()" -- ----------------------------------------------------------------------------------- -- ----------------------------------------------------------------------------------- -- Scene event functions -- ----------------------------------------------------------------------------------- -- create() function scene:create( event ) local sceneGroup = self.view -- Code here runs when the scene is first created but has not yet appeared on screen end -- show() function scene:show( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then -- Code here runs when the scene is still off screen (but is about to come on screen) local fzLogo = display.newImage("/img/fzideas.png",display.contentCenterX,display.contentCenterY) sceneGroup:insert(fzLogo) elseif ( phase == "did" ) then -- Code here runs when the scene is entirely on screen timer.performWithDelay( 6000, nextScene ) end end -- hide() function scene:hide( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then -- Code here runs when the scene is on screen (but is about to go off screen) elseif ( phase == "did" ) then -- Code here runs immediately after the scene goes entirely off screen end end -- destroy() function scene:destroy( event ) local sceneGroup = self.view -- Code here runs prior to the removal of scene's view end -- ----------------------------------------------------------------------------------- -- Scene event function listeners -- ----------------------------------------------------------------------------------- scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) -- ----------------------------------------------------------------------------------- return scene

Try leaving out the leading / on line 30. Make it read

local fzLogo = display.newImage(“img/fzideas.png”,display.contentCenterX,display.contentCenterY)

It’s helpful to understand how to debug things on devices. This guide can help you.

https://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

Hi Conor! Worked like a charm, I would have never imagined that was the problem. Thanks!!!

It could be interesting to have a warning in the console when we are in the simulator.

For the same kind of thing it could be great to have a warning on the simulator when we load a file and there is a problem of uppercase. On windows there is no error and on android it will crash

We issue warnings on case-mismatch errors. Oddly that leading slash I think should have failed on the simulator. unless your project file on your local computer is at C:\ on windows or  / on a Mac.

Rob

Had a case-mismatch 2 days ago, no warning. Windows 7. Never seen a case-mismatch error warning in all the years I’ve been using Corona.

Actually is in D:\ and within a quite long folder structure, as you can see in the screenshot. I was surprised though that that was the issue.

I’ve tried it in several devices, from phones to tablets and it runs great now.

Try leaving out the leading / on line 30. Make it read

local fzLogo = display.newImage(“img/fzideas.png”,display.contentCenterX,display.contentCenterY)

It’s helpful to understand how to debug things on devices. This guide can help you.

https://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

Hi Conor! Worked like a charm, I would have never imagined that was the problem. Thanks!!!

It could be interesting to have a warning in the console when we are in the simulator.

For the same kind of thing it could be great to have a warning on the simulator when we load a file and there is a problem of uppercase. On windows there is no error and on android it will crash

We issue warnings on case-mismatch errors. Oddly that leading slash I think should have failed on the simulator. unless your project file on your local computer is at C:\ on windows or  / on a Mac.

Rob

Had a case-mismatch 2 days ago, no warning. Windows 7. Never seen a case-mismatch error warning in all the years I’ve been using Corona.

Actually is in D:\ and within a quite long folder structure, as you can see in the screenshot. I was surprised though that that was the issue.

I’ve tried it in several devices, from phones to tablets and it runs great now.