Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Runtime Error: "Attempt to perform arithmetic on field 'contentHeight' (a nil value)"
Started by beesh Dec 27 2013 04:51 PM

* * * * * 1 votes
27 replies to this topic
[TOPIC CONTROLS]
Page 1 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

beesh

[GLOBAL: userInfoPane.html]
beesh
  • Observer

  • 11 posts
  • Corona SDK

We have had our app in the app store for while using Corona. 

 

I am currently on build: Version 2013.2100 (2013.12.7)

 

I have seen this bug in the past when jumping to a newer version of Corona. I have held back but now am making the jump to widget 2.0. 

 

 

Here is the error getting thrown:

 

Corona Simulator Runtime error

 

File: ?
 
Attempt to perform arithmetic on field 'contentHeight' (a nil value)

stack traceback:

 

    [C]: ?

 

    ?: in function '_manageRowLifeCycle'

 

    ?: in function <?:516>

 

    ?: in function <?:218>

 

So here is the deal. We jump from one scene to the next. Call it the home page to secondary page. On first load if you go from home page to secondary page it works fine. Then we have a back button to go back home. That works great. Then when you select to go the secondary page again this is where it breaks. 

 

I have googled : '_manageRowLifeCycle'

 

And it looks like on gitHub that is the part of the behind the scenes widget code. 

 

I am 99% positive it is a Corona bug. I have tableviews, scroll views, widget buttons, etc. 

 

Please let me know. Our app has been a case study in corona and we are kind of stuck!

Attached Thumbnails

  • Screen Shot 2013-12-27 at 4.45.46 PM.png


[TOPIC: post.html]
#2

beesh

[GLOBAL: userInfoPane.html]
beesh
  • Observer

  • 11 posts
  • Corona SDK

P.S. Earlier I meant to say we just went through Graphics 2.0 Transition not Widget 2.0 transition

 

Also I just went back through my code again!

 

The only thing I have seen so far might be from our past Widget 2.0 transition. 

 

In the Widget 2.0 Migration guide you will see it says no more: scrollView:takeFocus()

 

but we still have that in our code. 

 

But on the actually doc in the API found here:

 

http://docs.coronalabs.com/api/type/ScrollViewWidget/takeFocus.html

 

it shows that it is still in. IDK....



[TOPIC: post.html]
#3

mkelly

[GLOBAL: userInfoPane.html]
mkelly
  • Contributor

  • 124 posts
  • Corona SDK

did you ever figure this out. I'm getting this: "Attempt to perform arithmetic on field 'height' (a nil value)" when I return to a game level after going out of it temporarily (without purges or other hard nullification) to change something in the profile section. as in your example, there is no issue with performing math on height unless you leave and return...



[TOPIC: post.html]
#4

andrew69

[GLOBAL: userInfoPane.html]
andrew69
  • Observer

  • 6 posts
  • Corona SDK

I get this error when from a scene with a tableview I show an overlay with a scrollview. It only goes wrong when both tableview AND scrollview have sufficient content to scroll AND I add a row to the the tableview. Pretty obscure hey?

 

I have raised a bug - so fingers crossed.



[TOPIC: post.html]
#5

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,935 posts
  • Enterprise

@mkelly:  ""Attempt to perform arithmetic on field 'height' (a nil value)"" is a different error than the one being reported.  If you look in your console log, you should set a stack trace that gives you more information including line numbers where things went wrong.  Before anyone can help you we need to know what that says and see your code around the line numbers listed.

 

If you don't know how to read the console log, please read: http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

 

@andrew69, the bug listed at the top has been fixed for a while.  What version of Corona SDK are you using?  Like @mkelly, can you post the full error from the console log?

 

Thanks

Rob



[TOPIC: post.html]
#6

mkelly

[GLOBAL: userInfoPane.html]
mkelly
  • Contributor

  • 124 posts
  • Corona SDK

it appears that mine occurred from purging a scene where they choose an avatar from a scrolling set of characters. once I removed the widget library for the scrollview when purging the avatar scene, the random errors in the game level went away.

 

local widget = require("widget");
local widgetTableNumber = package.loaded.widget
 
function scene:didExitScene( event )
local group = self.view
package.loaded[ widgetTableNumber] = nil
timer.performWithDelay(1, function() collectgarbage("collect") end)
collectgarbage("step")
collectgarbage()
end
 
I purged the avatar scene on entering the game level after that, and all was well... I hope this helps @andrew69.


[TOPIC: post.html]
#7

andrew69

[GLOBAL: userInfoPane.html]
andrew69
  • Observer

  • 6 posts
  • Corona SDK

Hi Rob,

 

Sorry for the delay but I am in the UK.

 

I am using yesterdays daily build but I found the fault on 2189. I raised the bug (Case 33391) with a full sample which demonstrates the problem.

 

From the console:

 

Version: 3.0.0

Build: 2014.2332

2014-06-10 08:01:06.241 Corona Simulator[2930:507] Runtime error

?:0: attempt to perform arithmetic on field 'contentHeight' (a nil value)

stack traceback:

?: in function 'repositionY'

?: in function <?:1148>

(tail call): ?

/Users/andrewj/Desktop/Bug/scene1.lua:29: in function '_onRelease'

?: in function '?'

?: in function <?:677>

?: in function <?:218>

 

Thanks.



[TOPIC: post.html]
#8

andrew69

[GLOBAL: userInfoPane.html]
andrew69
  • Observer

  • 6 posts
  • Corona SDK

@mkelly: Hi, it seems that your error is different from mine. I did try your solution (thanks for giving it to me) but it had no effect. I must throw myself on the mercy of the fine people at Corona Labs unless this fine community can help.

 

Andrew



[TOPIC: post.html]
#9

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,935 posts
  • Enterprise

Andrew, its it still present in the latest daily builds?  There have been quite a few widget fixes since 2189.  We don't go back and patch the public build.  It's likely that what you're encountering could have been fixed already.  Is there a reason you're staying with 2189?  (and just to make sure you're aware, there is a 2189a that addresses a build problem for iOS that Apple is rejecting on...)

 

Rob



[TOPIC: post.html]
#10

andrew69

[GLOBAL: userInfoPane.html]
andrew69
  • Observer

  • 6 posts
  • Corona SDK

Hi Rob,

 

I am using daily build 2332 and the problem still exists.

 

Thanks,

 

Andrew



[TOPIC: post.html]
#11

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,935 posts
  • Enterprise

Are you getting the error with the same line numbers?

 

Do you by any chance have a copy of the widget library in your project?

 

Rob



[TOPIC: post.html]
#12

andrew69

[GLOBAL: userInfoPane.html]
andrew69
  • Observer

  • 6 posts
  • Corona SDK

Hi Rob,

 

I have no idea how to have a copy of the widget library in my project, I am just using the local widget = require( "widget" ) method of including it in each scene, so I guess the answer is no.

 

The stack trace when using 2189 is below - the line numbers are different so I guess that this proves that I am using a newer, supposedly fixed, version of the widget library.

 

Thanks, I do hope that we get to the bottom of this - it will require a major re-work of my design to use a mat hod that works.

 

Andrew

 

stack traceback:

?: in function 'repositionY'

?: in function <?:1116>

(tail call): ?

scene1.lua:29: in function '_onRelease'

?: in function '?'

?: in function <?:424>

?: in function <?:218>



[TOPIC: post.html]
#13

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,935 posts
  • Enterprise

I see you've filed a bug report on this.  Thank you. #33391

 

Rob



[TOPIC: post.html]
#14

andrew69

[GLOBAL: userInfoPane.html]
andrew69
  • Observer

  • 6 posts
  • Corona SDK

Woop! Fixed in Daily build 2014.2363. I tested it and it works fine.

 

Thanks Team!



[TOPIC: post.html]
#15

ryanBlue

[GLOBAL: userInfoPane.html]
ryanBlue
  • Observer

  • 6 posts
  • Corona SDK

Hi Rob, about issue on andrew69 post now it fixed yet? it cause from what ? if i still used 2014.2189, how to fixed it ? hope can u help this one . thanks



[TOPIC: post.html]
#16

ryanBlue

[GLOBAL: userInfoPane.html]
ryanBlue
  • Observer

  • 6 posts
  • Corona SDK

Hi, Can u help me this one .

 

Runtime error
        ?:0: attempt to perform arithmetic on field 'contentHeight' (a nil value
)
stack traceback:
        [C]: ?
        ?: in function 'repositionY'
        ?: in function <?:1116>
        (tail call): ?
-


[TOPIC: post.html]
#17

ryanBlue

[GLOBAL: userInfoPane.html]
ryanBlue
  • Observer

  • 6 posts
  • Corona SDK

Hi Rob,

 

I have no idea how to have a copy of the widget library in my project, I am just using the local widget = require( "widget" ) method of including it in each scene, so I guess the answer is no.

 

The stack trace when using 2189 is below - the line numbers are different so I guess that this proves that I am using a newer, supposedly fixed, version of the widget library.

 

Thanks, I do hope that we get to the bottom of this - it will require a major re-work of my design to use a mat hod that works.

 

Andrew

 

stack traceback:

?: in function 'repositionY'

?: in function <?:1116>

(tail call): ?

scene1.lua:29: in function '_onRelease'

?: in function '?'

?: in function <?:424>

?: in function <?:218>

 

this one fix yet? do you know why it error like this? it cause from what?



[TOPIC: post.html]
#18

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,935 posts
  • Enterprise

@soy.tola.rupp, what version of Corona SDK are you using?  As far as I know this has been fixed in Daily builds and will be available in the next public build. 



[TOPIC: post.html]
#19

malarkodi.sellamuthu

[GLOBAL: userInfoPane.html]
malarkodi.sellamuthu
  • Observer

  • 8 posts
  • Corona SDK

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



[TOPIC: post.html]
#20

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,935 posts
  • Enterprise

What version of Corona SDK are you using?

 

Rob



[TOPIC: post.html]
#21

malarkodi.sellamuthu

[GLOBAL: userInfoPane.html]
malarkodi.sellamuthu
  • Observer

  • 8 posts
  • Corona SDK

2015.2731(2015.10.5)



[TOPIC: post.html]
#22

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,935 posts
  • Enterprise

Can you try a later daily build?



[TOPIC: post.html]
#23

malarkodi.sellamuthu

[GLOBAL: userInfoPane.html]
malarkodi.sellamuthu
  • Observer

  • 8 posts
  • Corona SDK

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



[TOPIC: post.html]
#24

corona2824

[GLOBAL: userInfoPane.html]
corona2824
  • Observer

  • 12 posts
  • Corona SDK

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.



[TOPIC: post.html]
#25

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

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




[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]