Runtime Error: "Attempt to perform arithmetic on field 'contentHeight' (a nil value)"

Hi,

We have this problem too, for a few months. It happens on the last stable build (and also the previous ones).

We do have tableview inside scrollviews, however we need them, so we can’t really get rid of them. And it seems to happen in any screen, not directly on the actual screen where we have this.

I can’t provide a specific code sample since we have a huge game with a big architecture and I don’t know precisely where it comes from. I just know that it happens randomly (apparently, but I think it happens just before changing to a scene).

It also tends to happen a lot.

HI @corona2824,

If this is a Corona error, it shouldn’t be too difficult to pinpoint where it happens based on the stack traceback. See this tutorial and the “Console/Device Debugging > Viewing Runtime Errors” section to help you gather a line number where the error originates.

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

If you can get that, then perhaps we can help figure out which object the error is coming from, then debug from there.

Thanks,

Brent

Thing is we don’t have the stack.

I don’t know why, but most of the time errors on device don’t show any stack, just some “?” everywhere.

And it only happens on device, never on the simulator

More precisely, our errors look like that:

<Warning>: Runtime error

?:0: attempt to index field ‘?’ (a nil value)

stack traceback:

?: in function ‘changeSize’

?: in function ‘refresh’

?: in function <?:48>

?: in function ‘dispatchEvent’

?: in function ‘_nextTransition’

?: in function <?:1492>

?: in function ‘gotoScene’

?: in function ‘switchScene’

?: in function ‘clickCallback’

?: in function ‘click’

?: in function <?:60>

?: in function <?:221>

So, kinda hard to debug with all those “?”

Can you determine more specifically when it occurs? You mentioned when changing scenes. So, the scene you’re leaving contains the scrollView+tableView combo unit, or the scene you’re going to? Are you using the Composer library to manage scenes? Are the widgets properly located inside the scene’s view?

Brent

The proble is this happened randomly, I think it was on a scene change but I am not even sure, and it wasn’t always on the same screen.

I haven’t gotten this error since my last post, if I get it I will post the details here.

And yes we’re using composer. As for our widgets, in most of our scenes we destroy dynamic content (including lists) on the hide, and create it back on the show.

Still i have that issue.please check and let me know.

What version of Corona SDK are you using?

Rob

2015.2731(2015.10.5)

Can you try a later daily build?

My mistake only.i added tableview into scrollview.sorry friends for my chilly mistake.

Hi,

We have this problem too, for a few months. It happens on the last stable build (and also the previous ones).

We do have tableview inside scrollviews, however we need them, so we can’t really get rid of them. And it seems to happen in any screen, not directly on the actual screen where we have this.

I can’t provide a specific code sample since we have a huge game with a big architecture and I don’t know precisely where it comes from. I just know that it happens randomly (apparently, but I think it happens just before changing to a scene).

It also tends to happen a lot.

HI @corona2824,

If this is a Corona error, it shouldn’t be too difficult to pinpoint where it happens based on the stack traceback. See this tutorial and the “Console/Device Debugging > Viewing Runtime Errors” section to help you gather a line number where the error originates.

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

If you can get that, then perhaps we can help figure out which object the error is coming from, then debug from there.

Thanks,

Brent

Thing is we don’t have the stack.

I don’t know why, but most of the time errors on device don’t show any stack, just some “?” everywhere.

And it only happens on device, never on the simulator

More precisely, our errors look like that:

<Warning>: Runtime error

?:0: attempt to index field ‘?’ (a nil value)

stack traceback:

?: in function ‘changeSize’

?: in function ‘refresh’

?: in function <?:48>

?: in function ‘dispatchEvent’

?: in function ‘_nextTransition’

?: in function <?:1492>

?: in function ‘gotoScene’

?: in function ‘switchScene’

?: in function ‘clickCallback’

?: in function ‘click’

?: in function <?:60>

?: in function <?:221>

So, kinda hard to debug with all those “?”

Can you determine more specifically when it occurs? You mentioned when changing scenes. So, the scene you’re leaving contains the scrollView+tableView combo unit, or the scene you’re going to? Are you using the Composer library to manage scenes? Are the widgets properly located inside the scene’s view?

Brent

The proble is this happened randomly, I think it was on a scene change but I am not even sure, and it wasn’t always on the same screen.

I haven’t gotten this error since my last post, if I get it I will post the details here.

And yes we’re using composer. As for our widgets, in most of our scenes we destroy dynamic content (including lists) on the hide, and create it back on the show.