Cannot run apps built with 2421 on Android

I/Corona  ( 7410): Runtime error I/Corona  ( 7410): /Users/jenkins/slaveroot/workspace/Enterprise/OS/ios-7.1/release/release/platform/resources/init.lua:16: table index is nil I/Corona  ( 7410): stack traceback: I/Corona  ( 7410): /Users/jenkins/slaveroot/workspace/Enterprise/OS/ios-7.1/release/release/platform/resources/init.lua:16: in function 'getOrCreateTable' I/Corona  ( 7410): /Users/jenkins/slaveroot/workspace/Enterprise/OS/ios-7.1/release/release/platform/resources/init.lua:84: in function 'getOrCreateTable' I/Corona  ( 7410): /Users/jenkins/slaveroot/workspace/Enterprise/OS/ios-7.1/release/release/platform/resources/init.lua:129: in function 'addEventListener' I/Corona  ( 7410): /Users/jenkins/slaveroot/workspace/Enterprise/OS/ios-7.1/release/release/platform/resources/init.lua:302: in function 'addEventListener' I/Corona  ( 7410): ?: in main chunk I/Corona  ( 7410): [C]: in function 'require' I/Corona  ( 7410): /Users/jenkins/slaveroot/workspace/Enterprise/OS/ios-7.1/release/release/platform/resources/init.lua:820: in function 'require' I/Corona  ( 7410): ?: in function 'callback' I/Corona  ( 7410): ?: in function 'listener' I/Corona  ( 7410): /Users/jenkins/slaveroot/workspace/Enterprise/OS/ios-7.1/release/release/subrepos/timer/

This is what I get when I start my app on Android.

An error like that would generally be caused by calling addEventListener with a nil first argument.

Are you saying that this error suddenly appeared when you switched from some previous build to 2421?  If so, which previous build?

Perry Clarke:

actually this is very strange. This error appeared and disappeared after 15minutes. No changes at all to the project. I’m not sure how this could have happened myself, I looked at the error, went to chill out for a moment, came back, made another build and this time it worked [I did around few builds with this error before].
When we call addEventListener with nil first param we get a lua error, never this.
BTW, how on earth do I get errors with iOS path on Android? that’s extremely weird.

Anyway, thanks for the interest, but it went away. I’m not sure how. And… man… jenkins error? There’s clearly something wrong with your release process.

We don’t even have init.lua in our game.

I’m getting with Android upload: /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/storyboard/storyboard.lua:1613: in function ‘gotoScene’

please advise… thanks~

I think we’ll need just a smidge more detail than that before we can try and help :slight_smile:

What are you doing?  When does this message appear? What version of Corona are you using? What operating system are you on?

I uploaded a game with build #2014.2428 for beta testing. the download screen shows briefly, and then the screen goes black. it appears in the terminal using “adb log cat” that there’s an error on line 1613 in storybook.lua that’s stored in “users/jenkins/slaveroot” that’s preventing main from loading in home.lua. it loads in fine on the simulator. I’m on a Mac.

here’s more of the message:

09-23 18:00:40.559 14863 15062 I Corona  : Cannot transition to scene: home. There is either an error in the scene module, or you are attempting to go to a scene that does not exist. If you called storyboard.removeScene() on a scene that is NOT represented by a module, the scene must be re-created before transitioning back to it.

09-23 18:00:40.559 14863 15062 I Corona  : Runtime error

09-23 18:00:40.559 14863 15062 I Corona  : /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/storyboard/storyboard.lua:1613: ?:

I built this one with Version 2014.2439 (2014.9.19) hoping for different results. there’s nothing wrong with home.lua. the same file is being used in two successful iOS uploads and a multiplayer version of this one on Android.

The internal path on the error is only there because the error is being flagged in a system module (we have a bug open to improve these messages as it is confusing).

The issue is a runtime error in your scene management code which is described in the first message shown (“Cannot transition to …” etc).  I don’t know why it would behave differently on the device than in the Simulator.

main.lua and home.lua are almost the same in two iOS and identical to the one Android version. am not getting this error anywhere else.

main.lua:

local physics = require(“physics”);

physics.start();

physics.setScale(120);

physics.setVelocityIterations( 6 )

physics.setPositionIterations( 16 )

_W=display.viewableContentWidth

_H=display.viewableContentHeight

local storyboard = require “storyboard”

system.setAccelerometerInterval(30)

audio.setVolume( 1 )

if audio.supportsSessionProperty then

audio.setSessionProperty(audio.MixMode, audio.PlayAndRecordMixMode)

end

storyboard.gotoScene( “home”, “fade”, 400 )

home:

local storyboard = require( “storyboard” )

storyboard.isDebug=false

storyboard.disableAutoPurge = true 

storyboard.purgeOnSceneChange = true

local myData = require( “mydata” )

local device = require( “device” )

local prior_scene = storyboard.getPrevious()

local font = {}

if ( device.isAndroid ) then

   font.normal = “DroidSans”

   font.bold = “DroidSans-Bold”

end

local scene = storyboard.newScene()

function scene:createScene( event )

local group = self.view

local background = display.newImageRect(“images/homeBkgd.png”,display.actualContentWidth, display.actualContentHeight)

background.x = 320

background.y = display.actualContentHeight/2

group:insert(background)

background:toFront()

local about2 = display.newEmbossedText("",_W*.5, _H*.825, “DroidSans-Bold”, 40 )

about2.x=_W*.5

about2.y=_H*.025

about2.isEditable=false

if myData.imageScale2==true then

about2:setSize( 40 )

end

about2.hasBackground=false

about2.alpha=1

group:insert(about2)

about2:setText(“WELCOME!”)

local color = 

{    highlight =  {        r =1, g = 1, b = 0, a = .78

    },

    shadow =    {       r = 0, g = 0, b = 0, a = .5

    }

}

about2:setEmbossColor( color )

about2:setFillColor( .38, .22, .11 )

local function playGo(event)

storyboard.gotoScene(“profile” , “crossFade”, 1000)

end

if myData.imageScale==true then

start=display.newImageRect(“images/homePlayButton@2x.png”,326,104)

start.x=myData._W*.215

start.y=myData._H*.8

start:toFront()

start.alpha=0

elseif myData.imageScale2==true then

start=display.newImageRect(“images/homePlayButton@2x.png”,293,94)

start.x=myData._W*.215

start.y=myData._H*.8

start:toFront()

start.alpha=0

else

start=display.newImageRect(“images/homePlayButton.png”,163,52)

start.x=myData._W*.215

start.y=myData._H*.8

start:toFront()

start.alpha=0

end

group:insert(start)

start:addEventListener(“tap”,playGo)

local function instructionGo(e)

storyboard.gotoScene(“instructions2” , “crossFade”, 1000)

end

if myData.imageScale==true then

instruction=display.newImageRect(“images/instructionsButton@2x.png”,326,104)

instruction.x=myData._W*.785

instruction.y=myData._H*.8

instruction:toFront()

instruction.alpha=0

elseif myData.imageScale2==true then

instruction=display.newImageRect(“images/instructionsButton@2x.png”,293,94)

instruction.x=myData._W*.785

instruction.y=myData._H*.8

instruction:toFront()

instruction.alpha=0

else

instruction=display.newImageRect(“images/instructionsButton.png”,163,52)

instruction.x=myData._W*.785

instruction.y=myData._H*.8

instruction:toFront()

instruction.alpha=0

end

group:insert(instruction)

instruction:addEventListener(“tap”,instructionGo)

local logo = display.newImageRect(“images/giveMe5logo.png”,536, 440)

logo.x = 320

logo.y = 412

group:insert(logo)

transition.to( start, { time=1000, delay=500, alpha=1 } )

transition.to( instruction, { time=1000, delay=1000, alpha=1 } )

if imageScale==true or imageScale2 ==true then

logo.xScale=1.25

logo.yScale=1.25

start.xScale=1.5

start.yScale=1.5

profile.xScale=1.5

profile.yScale=1.5

start.x=150

profile.x=start.x+start.width*2

instruction.xScale=1.5

instruction.yScale=1.5

instruction.x=myData._W*.5

instruction.y=myData._H*.9125

end

end

function scene:exitScene( event )

end

function scene:enterScene(event)

local group = self.view

local prior_scene = storyboard.getPrevious()

if prior_scene ~= nil then

storyboard.purgeScene(prior_scene)

storyboard.purgeAll()

storyboard.removeAll()

end

end

function scene:didExitScene( event )

local group = self.view

timer.performWithDelay(1, function() collectgarbage(“collect”) end)

collectgarbage()

end

scene:addEventListener( “didExitScene”, scene )

scene:addEventListener( “enterScene”, scene )

– Called prior to the removal of scene’s “view” (display group)

function scene:destroyScene( event )

local group = self.view

end


– END OF YOUR IMPLEMENTATION


– “createScene” event is dispatched if scene’s view does not exist

scene:addEventListener( “createScene”, scene )

– “enterScene” event is dispatched whenever scene transition has finished

scene:addEventListener( “enterScene”, scene )

– “exitScene” event is dispatched before next scene’s transition begins

scene:addEventListener( “exitScene”, scene )

– “destroyScene” event is dispatched before view is unloaded, which can be

– automatically unloaded in low memory situations, or explicitly via a call to

– storyboard.purgeScene() or storyboard.removeScene().

scene:addEventListener( “destroyScene”, scene )


return scene

Are you trying to remove scenes?

Rob

it returns to home.lua after certain instances. yes, I’m trying to get rid of the scenes prior to that one to save memory. it doesn’t seem to pose a problem in the other versions or in the simulator.

I commented out all of the remove scene stuff and just re-uploaded to googlePlay. will know in a couple hours if it makes any difference.

it’s working. so how was the purge/remove code hampering it when the same are in place in the other versions?

Well it’s hard to tell.  First, it’s really helpful when you post code to put it inside and brackets (leaving out the space) so that any indentions are kept.

Next, You’re using Storyboard, which we’ve deprecated in favor of Composer.  It’s very likely if you try to remove a scene at the wrong time, it could cause issues.

Rob

thanks Rob,

yeah, I had actually started redoing it with Composer when the error appeared the other day, but the time factor prevented completion.

will the storyboard deprecation affect future downloads of the other three versions of this game?

will code view from now on. thanks for the tip…

Any apps that you put in the store are not impacted by changes we make after the fact.  If you do an update, it would be impacted by changes we make.  Once you build, we can’t change the contents of that build.

Rob

three final questions (hope they’re not too naive): 1) if I add_ local storyboard = require(“storyboard.storyboard”)_ after placing the storyboard.lua file dated Jan 21, 2014 that I downloaded from git into said folder inside my main folder, will that bulletproof my updates since they wouldn’t be reaching out to your deprecated version anymore (or are they one and the same)? 2) would building with earlier Corona SDK versions such as 2014.2424 (which I used for the previous versions of the game) improve chances of being storyboard error free? 3) since Corona has deprecated storyboard, that means you guys will be making no further changes to it, but were there changes made to it in the period between when my versions were published in early September and the most recent one that caused identical storyboard code references inside the latest one to degenerate to madness?

thanks again! I’m really worried about updates. I don’t want to have to update four games to Composer to keep them out there if I can avoid it. storyboard seemed to working fine memory managing and such (after following the tutorials you wrote).

1.  I wouldn’t necessarily drop it into a folder named storyboard, just drop the storyboard.lua file in your folder with your main.lua and you will start using it instead of the internal one.  When we finally remove our storyboard you won’t miss a beat.

  1. No.  Storyboard hasn’t been updated in quite a while, at least not since we introduced Composer and we are not going to update it.

3.  The version of storyboard that you can download from github is the final version.  I don’t know what build you built your apps with, so there is a chance there are changes since your apps were published.  But if they are working with the latest public build, that should be the same Storyboard code.

Rob

great to know. thanks, Rob!

An error like that would generally be caused by calling addEventListener with a nil first argument.

Are you saying that this error suddenly appeared when you switched from some previous build to 2421?  If so, which previous build?