issue moving from "Debug Build" to "Release Build"

Hi all

I finally moved from “Debug Build” to “Release Build” and I found that both builds do not behave the same.

I found that the “Back” key in the Release build don’t behave as expected and it is not stable.

In my design I use the “back”  key to enter the Pause overlay  during the game or to go back to a specific  scene (not during the game, for example from “select-level” to “menu”)

In “Debug Build” all the transition between scenes on my phone work perfectly, but when I created a “Release Build”  this is no longer the case.

During the game the “Back” key don’t show the “Pause” overlay, and not during the game the “Back” key sometimes working and sometimes not, sometimes it exit completely from the game.

Code in the game scene

local function onKeyEvent( event )

local phase = event.phase

local keyName = event.keyName

if ( “back” == keyName and phase == “up” and overlayOn == 0) then

physics.pause ()

if (tmr ~= nil) then

timer.pause(tmr);

end

if blinkTimer then

timer.pause(blinkTimer)

end

if emptyBoxTimer then

timer.pause(emptyBoxTimer)

end

local options =

{

isModal = true,         

effect = “fromTop”,

time = 500,

}

composer.showOverlay( “exitOverlay”, options  )

overlayOn = 1

return true

end

return false

end

Code in levelselect scene

local function onKeyEvent( event )

local phase = event.phase

local keyName = event.keyName

if ( “back” == keyName and phase == “up” ) then

composer.gotoScene(“menu”, { effect = “crossFade”, time = 333, isModal = true })

return true

end

return false

end

I also try to remove the ‘return false’ and I receive the same results

Any ideas?

Regards,

Gu

First please post code using the blue <> button in the row with bold, italic, etc. Click on it, paste your code into the popup window. It makes reading your code so much easier. You should do this for each block of code.

I have no idea why going from a Debug build to a Release build would change this behavior. All we are doing is changing the key we sign the app with and stripping some debug information.  You can try turning that off. See:

https://docs.coronalabs.com/guide/distribution/buildSettings/index.html#build-control

From what I can tell your code looks reasonable. I’m always concerned when you have two key events going on at the same time. Perhaps you should remove one before changing scenes. 

Rob

Hi Rob,

Thank you for your reply

I found the problem and it was my mistake.
I forgot to save a file i change so the final build was based on the wrong file.

Guy

First please post code using the blue <> button in the row with bold, italic, etc. Click on it, paste your code into the popup window. It makes reading your code so much easier. You should do this for each block of code.

I have no idea why going from a Debug build to a Release build would change this behavior. All we are doing is changing the key we sign the app with and stripping some debug information.  You can try turning that off. See:

https://docs.coronalabs.com/guide/distribution/buildSettings/index.html#build-control

From what I can tell your code looks reasonable. I’m always concerned when you have two key events going on at the same time. Perhaps you should remove one before changing scenes. 

Rob

Hi Rob,

Thank you for your reply

I found the problem and it was my mistake.
I forgot to save a file i change so the final build was based on the wrong file.

Guy