scrollView runtime errors

What version of Corona SDK are you using?

Do you have a local copy of the widget library?  You shouldn’t need to have included that file.

Rob

I’m sorry but I don’t understand. What is a local copy of the widget library ? Do I need to download from github or something ? I followed instructions and copied the jar and .so files to the correct folders and started writing the app. The widget lib was available by default. Also I am using the trial version.

You should not need to get anything from GitHub for this.  Everything should be included in the core.  However, the widget library is open source and some people have downloaded it from github and put it in the folder with their main.lua.  If you had an older version that you had downloaded, it could be interfering with the version we provide by default.  Having to download the theme files is a symptom of this.

However, I’m not that familiar with Corona Cards, but I can’t see why this would be an issue.

Any way if you are working, you should be good to go.

Rob

I have similar problem but with your tableView widget. This occurs when adding rows to it. I do not set themes for it. Just the simpliest form.

This is my log:

11-14 22:35:02.434: I/Corona(3106): Runtime error 11-14 22:35:02.434: I/Corona(3106): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget\_momentumScrolling.lua:709: attempt to index field 'topFrame' (a nil value) 11-14 22:35:02.434: I/Corona(3106): stack traceback: 11-14 22:35:02.434: I/Corona(3106): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget\_momentumScrolling.lua:709: in function 'createScrollBar' 11-14 22:35:02.434: I/Corona(3106): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget\_tableview.lua:541: in function 'method' 11-14 22:35:02.434: I/Corona(3106): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/platform/resources/init.lua:253: in function \</Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/platform/resources/init.lua:221\> 11-14 22:35:02.444: I/Corona(3106): Warning: /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget\_momentumScrolling.lua:700: Failed to find image 'widget\_theme\_android.png' 11-14 22:35:02.444: I/Corona(3106): Error: /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget\_momentumScrolling.lua:707: display.newImageRect() bad argument #2: filename or image sheet expected, but got nil

My build for CoronaCards is 2014.2505

I would offer the same advice, do a:

widget.setTheme(“widget_theme_ios7”)

See: http://docs.coronalabs.com/api/library/widget/setTheme.html

We are seeing the same error message, using Corona Enterprise and the core widget lib (haven’t downloaded the source).

02-02 13:06:57.533: I/Corona(3065): Runtime error 02-02 13:06:57.533: I/Corona(3065): /Users/jenkins/slaveroot/workspace/Enterprise/OS/xcode-6.1.1/release/release/subrepos/widget/widgetLibrary/widget\_momentumScrolling.lua:664: attempt to index field 'parent' (a nil value) 02-02 13:06:57.533: I/Corona(3065): stack traceback: 02-02 13:06:57.533: I/Corona(3065): /Users/jenkins/slaveroot/workspace/Enterprise/OS/xcode-6.1.1/release/release/subrepos/widget/widgetLibrary/widget\_momentumScrolling.lua:664: in function 'createScrollBar' 02-02 13:06:57.533: I/Corona(3065): /Users/jenkins/slaveroot/workspace/Enterprise/OS/xcode-6.1.1/release/release/subrepos/widget/widgetLibrary/widget\_scrollview.lua:462: in function 'listener' 02-02 13:06:57.533: I/Corona(3065): /Users/jenkins/slaveroot/workspace/Enterprise/OS/xcode-6.1.1/release/release/subrepos/timer/timer.lua:173: in function 'method' 02-02 13:06:57.533: I/Corona(3065): /Users/jenkins/slaveroot/workspace/Enterprise/OS/xcode-6.1.1/release/release/platform/resources/init.lua:253: in function \</Users/jenkins/slaveroot/workspace/Enterprise/OS/xcode-6.1.1/release/release/platform/resources/init.lua:221\>

I’m only seeing the error on Android, but it’s possible it may happen on iOS too if I test for long enough. 

The “widget_momentumScrolling” part makes me think that the scrollview is trying to continue scrolling after it’s been removed.

Edit: I’ve just looked at the source code on github, and the error message is coming from this part here:

function M.createScrollBar( view, options ) -- Require needed widget files local \_widget = require( "widget" ) local opt = {} local customOptions = options or {} -- Setup the scrollBar's width/height local parentGroup = view.parent.parent --HERE

Our scroll views are on separate option screens, and it’s fairly easy to move from one to another. My guess is that the widget lib is trying to draw a scrollbar onto a scrollview which no longer exists. Is there a way around this? Could Corona perhaps add an:

if view == nil or view.parent == nil then return end

into the function.

This is causing crashing in all of our games :-(. Any ETA on a fix?

Download themes, like “widget_theme_ios7.png” should fix the problem. Like it did with all others

I didn’t notice when I first came across this post that it was in the Corona Cards forum (found it via Google) so apologies since I’m an Enterprise user. I can see in the original post that the error message is saying it cannot find index “topFrame” which is presumably the image that was not available. My understanding however, is that Enterprise does include them and this same fix will not work for us (it didn’t when I tested it).

Our error is that if a scrollview is removed quickly after the call to create it is made, an error occurs (and crashes the app). The error is always the same:

/Users/jenkins/slaveroot/workspace/Enterprise/OS/xcode-6.1.1/release/release/subrepos/widget/widgetLibrary/widget\_momentumScrolling.lua:664: attempt to index field 'parent' (a nil value)

As mentioned before, I’m pretty sure it’s because the scrollbar is being created, but the parent object (presumably the scrollview itself) no longer exists. Since the user can press 1 tab and then another in our app as quickly as they want, we don’t have full control over the time between creating the scroll view and removing it.

It’s also not very user friendly to force some kind of lockout on the buttons that move from 1 tab to another, as it will seem like a button is unresponsive.

I could create another post on one of the other forums, but given the title of this post it seems like other people who experience our error may end up here anyway so perhaps this is a good place to leave it.

You could always put the code to delete the tableView in a timer after a few milliseconds.  Hide it when you transition away, and give it time to delete itself. 

i had same problem but downloading widget_theme_ios7.png fixed problem used most recent coronaCards trial with android studio.

CoronaCards does not contain the assets for widgets.  Downloading them from Github is the correct thing to do.

Rob

We are seeing the same error message, using Corona Enterprise and the core widget lib (haven’t downloaded the source).

02-02 13:06:57.533: I/Corona(3065): Runtime error 02-02 13:06:57.533: I/Corona(3065): /Users/jenkins/slaveroot/workspace/Enterprise/OS/xcode-6.1.1/release/release/subrepos/widget/widgetLibrary/widget\_momentumScrolling.lua:664: attempt to index field 'parent' (a nil value) 02-02 13:06:57.533: I/Corona(3065): stack traceback: 02-02 13:06:57.533: I/Corona(3065): /Users/jenkins/slaveroot/workspace/Enterprise/OS/xcode-6.1.1/release/release/subrepos/widget/widgetLibrary/widget\_momentumScrolling.lua:664: in function 'createScrollBar' 02-02 13:06:57.533: I/Corona(3065): /Users/jenkins/slaveroot/workspace/Enterprise/OS/xcode-6.1.1/release/release/subrepos/widget/widgetLibrary/widget\_scrollview.lua:462: in function 'listener' 02-02 13:06:57.533: I/Corona(3065): /Users/jenkins/slaveroot/workspace/Enterprise/OS/xcode-6.1.1/release/release/subrepos/timer/timer.lua:173: in function 'method' 02-02 13:06:57.533: I/Corona(3065): /Users/jenkins/slaveroot/workspace/Enterprise/OS/xcode-6.1.1/release/release/platform/resources/init.lua:253: in function \</Users/jenkins/slaveroot/workspace/Enterprise/OS/xcode-6.1.1/release/release/platform/resources/init.lua:221\>

I’m only seeing the error on Android, but it’s possible it may happen on iOS too if I test for long enough. 

The “widget_momentumScrolling” part makes me think that the scrollview is trying to continue scrolling after it’s been removed.

Edit: I’ve just looked at the source code on github, and the error message is coming from this part here:

function M.createScrollBar( view, options ) -- Require needed widget files local \_widget = require( "widget" ) local opt = {} local customOptions = options or {} -- Setup the scrollBar's width/height local parentGroup = view.parent.parent --HERE

Our scroll views are on separate option screens, and it’s fairly easy to move from one to another. My guess is that the widget lib is trying to draw a scrollbar onto a scrollview which no longer exists. Is there a way around this? Could Corona perhaps add an:

if view == nil or view.parent == nil then return end

into the function.

This is causing crashing in all of our games :-(. Any ETA on a fix?

Download themes, like “widget_theme_ios7.png” should fix the problem. Like it did with all others

I didn’t notice when I first came across this post that it was in the Corona Cards forum (found it via Google) so apologies since I’m an Enterprise user. I can see in the original post that the error message is saying it cannot find index “topFrame” which is presumably the image that was not available. My understanding however, is that Enterprise does include them and this same fix will not work for us (it didn’t when I tested it).

Our error is that if a scrollview is removed quickly after the call to create it is made, an error occurs (and crashes the app). The error is always the same:

/Users/jenkins/slaveroot/workspace/Enterprise/OS/xcode-6.1.1/release/release/subrepos/widget/widgetLibrary/widget\_momentumScrolling.lua:664: attempt to index field 'parent' (a nil value)

As mentioned before, I’m pretty sure it’s because the scrollbar is being created, but the parent object (presumably the scrollview itself) no longer exists. Since the user can press 1 tab and then another in our app as quickly as they want, we don’t have full control over the time between creating the scroll view and removing it.

It’s also not very user friendly to force some kind of lockout on the buttons that move from 1 tab to another, as it will seem like a button is unresponsive.

I could create another post on one of the other forums, but given the title of this post it seems like other people who experience our error may end up here anyway so perhaps this is a good place to leave it.

You could always put the code to delete the tableView in a timer after a few milliseconds.  Hide it when you transition away, and give it time to delete itself. 

Yeah, this is a problem, I think.  Everything was working before at some point (I’m not sure what version of Corona I used to build my last good release.)

But now, everything is great on the Simulator, but fails on iOS when I do this:

widget.setTheme( “widget_theme_ios7” )

I get the error:

WARNING: Failed to find image ‘widget_theme_ios7.png’

Then a series of errors about bad argument, followed by a runtime error.

When I do a build, I can see in the console that it is added:

Jul 14 10:34:28.937:   adding: Floorvana.app/CoronaResources.bundle/widget_theme_ios7.png (deflated 6%)

Jul 14 10:34:28.940:   adding: Floorvana.app/CoronaResources.bundle/widget_theme_ios7@2x.png (deflated 10%)

Jul 14 10:34:28.946:   adding: Floorvana.app/CoronaResources.bundle/widget_theme_ios7@4x.png (deflated 9%)

 

does this mean widget.setTheme is broken perhaps and is no longer looking in this other location first?

I grabbed the appropriate png and lua files from framework-widget, put them in my root folder, and it worked, so I think something has definitely changed there with setTheme because I’ve never had to do it before.

Yeah, this is a problem, I think.  Everything was working before at some point (I’m not sure what version of Corona I used to build my last good release.)

But now, everything is great on the Simulator, but fails on iOS when I do this:

widget.setTheme( “widget_theme_ios7” )

I get the error:

WARNING: Failed to find image ‘widget_theme_ios7.png’

Then a series of errors about bad argument, followed by a runtime error.

When I do a build, I can see in the console that it is added:

Jul 14 10:34:28.937:   adding: Floorvana.app/CoronaResources.bundle/widget_theme_ios7.png (deflated 6%)

Jul 14 10:34:28.940:   adding: Floorvana.app/CoronaResources.bundle/widget_theme_ios7@2x.png (deflated 10%)

Jul 14 10:34:28.946:   adding: Floorvana.app/CoronaResources.bundle/widget_theme_ios7@4x.png (deflated 9%)

 

does this mean widget.setTheme is broken perhaps and is no longer looking in this other location first?