enterprise corona - jenkins/slveroot/workspace timer error

/users/jenkins/slaveroot/workspace/enterprise/OS/xcode-6.3/release/release/subrepos/timer/timer.lua64

attempt to index local ‘entry’ (a nil value)

guys could anyone tell me what is this error? what does it say?

on some devices exactly when people launch the app, after 2 or 3 seconds this error appears and on some others it doesn’t.

I don’t have any clue on that. 

thank you in advance for your response :wink:

You must have a variable or field named ‘entry’ in your code you are trying to modify in a timer called function.  

Add this to the build.settings to get a better debug message from the device:

settings = { build = { neverStripDebugInfo = true } }

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

I got this too in some devices, with no idea… (Corona version 2722 Mac)

/Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/timer/timer.lua:47:attempt to index local ‘entry’ (a nil value)

“entry” is something inside Corona’s timer.lua

@roaminggamer

 still don’t get the problem.

I did a lot of research across the web and it seems every person who face these kind of problems, have basically changed their code.

You’re saying you didn’t get a better debug message/log output?  I was hoping you’d be able to narrow in on the source line.

Consider that you might have left a timer running after changing scenes and or destroying an object the timer is operating on.  

I’d look at each timer I start and ask myself this question:

"Is the code activated by the timer operating on an object that could be deleted before the timer fires. "

If, “Yes,” then continue…

For each of these cases, either:

A. Cancel the timer when you remove the dependent object(s).

B. Put in safety code:

These are NOT SAFE:

-- Both examples will crash -- Version 1 - Manipulating object via timed closure -- local obj = display.newCircle( 10, 10, 10) timer.performWithDelay( 500, function() obj.x = obj.x + 10 end ) display.remove(obj) -- Version 2 - Manipulating object via timed local function -- local obj2 = display.newCircle( 10, 10, 10) function obj2.timer( self ) self.x = self.x + 10 end timer.performWithDelay( 500, obj2 ) display.remove(obj)

These are SAFE:

-- Both examples will abort early and safely -- Version 1 - Manipulating object via timed closure -- local obj = display.newCircle( 10, 10, 10) timer.performWithDelay( 500, function() if( obj.removeSelf == nil ) then return end obj.x = obj.x + 10 end ) display.remove(obj) -- Version 2 - Manipulating object via timed local function -- local obj2 = display.newCircle( 10, 10, 10) function obj2.timer( self ) if( self.removeSelf == nil ) then return end self.x = self.x + 10 end timer.performWithDelay( 500, obj2 ) display.remove(obj)

Which build are you using? It looks like (if you’re using a recent build) you’re trying to pause or cancel an nil value. We should provide a more informative assert here, but you should likely check for a valid timer before trying to cancel, pause, or resume it.

You must have a variable or field named ‘entry’ in your code you are trying to modify in a timer called function.  

Add this to the build.settings to get a better debug message from the device:

settings = { build = { neverStripDebugInfo = true } }

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

I got this too in some devices, with no idea… (Corona version 2722 Mac)

/Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/timer/timer.lua:47:attempt to index local ‘entry’ (a nil value)

“entry” is something inside Corona’s timer.lua

@roaminggamer

 still don’t get the problem.

I did a lot of research across the web and it seems every person who face these kind of problems, have basically changed their code.

You’re saying you didn’t get a better debug message/log output?  I was hoping you’d be able to narrow in on the source line.

Consider that you might have left a timer running after changing scenes and or destroying an object the timer is operating on.  

I’d look at each timer I start and ask myself this question:

"Is the code activated by the timer operating on an object that could be deleted before the timer fires. "

If, “Yes,” then continue…

For each of these cases, either:

A. Cancel the timer when you remove the dependent object(s).

B. Put in safety code:

These are NOT SAFE:

-- Both examples will crash -- Version 1 - Manipulating object via timed closure -- local obj = display.newCircle( 10, 10, 10) timer.performWithDelay( 500, function() obj.x = obj.x + 10 end ) display.remove(obj) -- Version 2 - Manipulating object via timed local function -- local obj2 = display.newCircle( 10, 10, 10) function obj2.timer( self ) self.x = self.x + 10 end timer.performWithDelay( 500, obj2 ) display.remove(obj)

These are SAFE:

-- Both examples will abort early and safely -- Version 1 - Manipulating object via timed closure -- local obj = display.newCircle( 10, 10, 10) timer.performWithDelay( 500, function() if( obj.removeSelf == nil ) then return end obj.x = obj.x + 10 end ) display.remove(obj) -- Version 2 - Manipulating object via timed local function -- local obj2 = display.newCircle( 10, 10, 10) function obj2.timer( self ) if( self.removeSelf == nil ) then return end self.x = self.x + 10 end timer.performWithDelay( 500, obj2 ) display.remove(obj)

Which build are you using? It looks like (if you’re using a recent build) you’re trying to pause or cancel an nil value. We should provide a more informative assert here, but you should likely check for a valid timer before trying to cancel, pause, or resume it.