Getting Stack Traceback Errors only in new Corona Versions, Old Corona Simulator works fine

I’ve been working on my first simple app for a few months now, and I haven’t had an issue so far, but from one day to the next, it started giving me Stack Traceback error, without me even changing any code!
 
I then realized I had updated Corona, and checked with older versions. My project runs fine on version 2015.2731, but errors out on 2015.2778 and also 2016.2808, which are the ones I’ve tried.
 
I have no clue what’s wrong. The error points to the following code:

 function selectButton:touchEnded() audio.play(buttonSFX, {channel = audio.findFreeChannel()}); self:setFillColor(1, 1, 1); self.xScale, self.yScale = 1, 1; composer.gotoScene("gameScene", "fade"); end

Specifically  “composer.gotoScene(“gameScene”, “fade”);” I check gameScene.lua, and find no problem.

Was there a change in the builds that might make my code not work??

Hi @lgv212,

For the Composer “gotoScene()” function, you need to pass a table of options as the second parameter. This table contains the effect, time, and options variables to pass to the scene. See the documentation for details:

https://docs.coronalabs.com/api/library/composer/gotoScene.html

Take care,

Brent

Hello Brent,

Thanks for the reply.

I changed it to 

composer.gotoScene(“gameScene”, {time=250, effect =“fade”});

But got the same issue. :(  I tried putting it in an option array/table, and same problem (still works fine in release 2015.2731)

The error points to the same code, but also mentions this code in the error:

 function button:touch(event) if event.phase == "began" then display.getCurrentStage():setFocus(self); self.isFocus = true; if self.touchBegan then self:touchBegan(); end return true; elseif event.phase == "moved" and self.isFocus then local bounds = self.contentBounds; if event.x \> bounds.xMax or event.x \< bounds.xMin or event.y \> bounds.yMax or event.y \< bounds.yMin then self.isFocus = false; display.getCurrentStage():setFocus(nil); if self.touchEnded then self:touchEnded(); end end return true; elseif event.phase == "ended" and self.isFocus then self.isFocus = false; display.getCurrentStage():setFocus(nil); if self.touchEnded then self:touchEnded(); end

and more specifically 

if self.touchEnded then self:touchEnded(); end

That is the last line it mentions within the error.

What could it be that is only giving an error on new releases, but no problem on an older release? I tried looking through the daily builds since then, but I haven’t finished going through all the changelogs. 

Any idea?  :huh:

Thanks!

Hi @lgv212,

I’m not sure why this would be working in older builds but not the current build. At a glance, it looks like a Lua error involved with how you’re trying to call a function with the colon operator, but it’s actually a property of the button as declared by the dot operator. Perhaps the function doesn’t even exist?

Is this button a custom one you’ve created? Is there a reason why you’re using this method instead of simply using a widget button (widget.newButton())?

Brent

i had similar issues and banged my head to the wall. I could solve this. Since i had my projectfolder within my dropbox, i moved it out of there to my documents folder (on mac) and bam! my builds worked again. I have no idea why, but since then i don`t build out of my dropbox folder again. This issue started with one of the latest builds. i had a longer break on developing with corona and when i continued an older project i had this sideeffect with errormessages out of nowhere when building, while the same code worked flawless before upgrading to newer builds. Moving my projectfolder to another location solved my issue.

Wow, this was it! I was running the project out of my Dropbox folder. As soon as i made a copy of the project folder out on my desktop and tried running it again, it worked flawlessly on the newest Corona builds. That is definitely a weird issue. You saved me hours and days of frustration.

Edit: I’d also like to add that I’m also using Mac

Brent, to be honest, i didn’t know about widget! Like i said before, I’m a beginner and learning as i go. That widget.newbutton definitely makes my life easier thou. I’ll be using that from now on

Hi @lgv212,

For the Composer “gotoScene()” function, you need to pass a table of options as the second parameter. This table contains the effect, time, and options variables to pass to the scene. See the documentation for details:

https://docs.coronalabs.com/api/library/composer/gotoScene.html

Take care,

Brent

Hello Brent,

Thanks for the reply.

I changed it to 

composer.gotoScene(“gameScene”, {time=250, effect =“fade”});

But got the same issue. :(  I tried putting it in an option array/table, and same problem (still works fine in release 2015.2731)

The error points to the same code, but also mentions this code in the error:

 function button:touch(event) if event.phase == "began" then display.getCurrentStage():setFocus(self); self.isFocus = true; if self.touchBegan then self:touchBegan(); end return true; elseif event.phase == "moved" and self.isFocus then local bounds = self.contentBounds; if event.x \> bounds.xMax or event.x \< bounds.xMin or event.y \> bounds.yMax or event.y \< bounds.yMin then self.isFocus = false; display.getCurrentStage():setFocus(nil); if self.touchEnded then self:touchEnded(); end end return true; elseif event.phase == "ended" and self.isFocus then self.isFocus = false; display.getCurrentStage():setFocus(nil); if self.touchEnded then self:touchEnded(); end

and more specifically 

if self.touchEnded then self:touchEnded(); end

That is the last line it mentions within the error.

What could it be that is only giving an error on new releases, but no problem on an older release? I tried looking through the daily builds since then, but I haven’t finished going through all the changelogs. 

Any idea?  :huh:

Thanks!

Hi @lgv212,

I’m not sure why this would be working in older builds but not the current build. At a glance, it looks like a Lua error involved with how you’re trying to call a function with the colon operator, but it’s actually a property of the button as declared by the dot operator. Perhaps the function doesn’t even exist?

Is this button a custom one you’ve created? Is there a reason why you’re using this method instead of simply using a widget button (widget.newButton())?

Brent

i had similar issues and banged my head to the wall. I could solve this. Since i had my projectfolder within my dropbox, i moved it out of there to my documents folder (on mac) and bam! my builds worked again. I have no idea why, but since then i don`t build out of my dropbox folder again. This issue started with one of the latest builds. i had a longer break on developing with corona and when i continued an older project i had this sideeffect with errormessages out of nowhere when building, while the same code worked flawless before upgrading to newer builds. Moving my projectfolder to another location solved my issue.

Wow, this was it! I was running the project out of my Dropbox folder. As soon as i made a copy of the project folder out on my desktop and tried running it again, it worked flawlessly on the newest Corona builds. That is definitely a weird issue. You saved me hours and days of frustration.

Edit: I’d also like to add that I’m also using Mac

Brent, to be honest, i didn’t know about widget! Like i said before, I’m a beginner and learning as i go. That widget.newbutton definitely makes my life easier thou. I’ll be using that from now on