scrollView runtime errors

Hi

I am creating a scrollView as follows:

 local scrollView = widget.newScrollView

    {

        top = screenheight*0.2,

        left = margin,

        width = screenwidth - margin*2,

        height = screenheight - screenheight*0.2 - margin,

    }

    root:insert(scrollView)

Then in a loop I add several images/buttons to it. It all renders fine and works OK but there was a slowdown if when I transitioned out and came back into this screen. I noticed that this was because of a huge number or error messages and stack traces being written out. There seems to be a runtime error. Here are a few of the errors, the repeat a hundred or so times…I guess each time I add an element to the scrollView. “TopFrame” seems to be related to the scrollbars and the parameter scrollBarOptions is optional I believe. Am I doing something wrong ? 

11-09 12:14:34.986: I/Corona(10999): Runtime error

11-09 12:14:34.986: I/Corona(10999): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget_momentumScrolling.lua:713: attempt to index field ‘topFrame’ (a nil value)

11-09 12:14:34.986: I/Corona(10999): stack traceback:

11-09 12:14:34.986: I/Corona(10999): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget_momentumScrolling.lua:713: in function ‘createScrollBar’

11-09 12:14:34.986: I/Corona(10999): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget_scrollview.lua:411: in function ‘listener’

11-09 12:14:34.986: I/Corona(10999): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/timer/timer.lua:173: in function ‘method’

11-09 12:14:34.986: I/Corona(10999): /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-09 12:14:35.036: I/Corona(10999): Runtime error

11-09 12:14:35.036: I/Corona(10999): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget_momentumScrolling.lua:713: attempt to index field ‘topFrame’ (a nil value)

11-09 12:14:35.036: I/Corona(10999): stack traceback:

11-09 12:14:35.036: I/Corona(10999): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget_momentumScrolling.lua:713: in function ‘createScrollBar’

11-09 12:14:35.036: I/Corona(10999): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget_scrollview.lua:411: in function ‘listener’

11-09 12:14:35.036: I/Corona(10999): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/timer/timer.lua:173: in function ‘method’

11-09 12:14:35.036: I/Corona(10999): /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-09 12:14:35.046: I/Corona(10999): Runtime error

11-09 12:14:35.046: I/Corona(10999): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget_momentumScrolling.lua:713: attempt to index field ‘topFrame’ (a nil value)

11-09 12:14:35.046: I/Corona(10999): stack traceback:

11-09 12:14:42.636: I/Corona(10999): Runtime error

11-09 12:14:42.636: I/Corona(10999): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget_momentumScrolling.lua:713: attempt to index field ‘topFrame’ (a nil value)

11-09 12:14:42.636: I/Corona(10999): stack traceback:

11-09 12:14:42.636: I/Corona(10999): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget_momentumScrolling.lua:713: in function ‘createScrollBar’

11-09 12:14:42.636: I/Corona(10999): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/widget/widgetLibrary/widget_scrollview.lua:411: in function ‘listener’

11-09 12:14:42.636: I/Corona(10999): /Users/jenkins/slaveroot/workspace/CoronaCards/OS/android/subrepos/timer/timer.lua:173: in function ‘method’

11-09 12:14:42.636: I/Corona(10999): /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>

Yes, that appears to be scrollbar related and you’re not specifying anything about scroll bars (and it is optional). 

What version of CoronaCards are you running?  Are you using CoronaCards or are you building this with CoronaSDK?

Thanks

Rob

I am evaluating corona cards and I down the latest build 10 days back. It seems fine in the simulator but on an android device (Nexus5 android 4.4) it has this issue. The app also slows down due to the large amount of debug messages.

Is the trial version limited in some way graphically, like hardware acceleration off, because transitions and scrolling stutters and this is a high end phone.

The
Sanjit

Not that I’m aware of.  There were a bunch of widget fixes in 2481.  The trial is on an older version.  This might have been fixed.

Can you try to provide the parts to do a scroll bar?  Can you try a different widget theme too?  What widget theme are you using?

Thanks

Rob

Hi Rob

The errors went away after I did a widget:settheme(). Also had to download and include the theme png from https://github.com/coronalabs/framework-widget … 

Thanks

Sanjit

What theme are you using?  The core themes for iOS  7/8, iOS 6 and earlier, our older android theme should already be in the core.  The new holo themes will be in the next public build. Perhaps those are the ones you downloaded.

Rob

local widget = require(“widget”)

widget.setTheme( “widget_theme_ios7” )

I have to add widget_theme_ios7.png to the assets folder or else all the runtime errors reappear…

Thx

Sanjit

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

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

Yes, that appears to be scrollbar related and you’re not specifying anything about scroll bars (and it is optional). 

What version of CoronaCards are you running?  Are you using CoronaCards or are you building this with CoronaSDK?

Thanks

Rob

I am evaluating corona cards and I down the latest build 10 days back. It seems fine in the simulator but on an android device (Nexus5 android 4.4) it has this issue. The app also slows down due to the large amount of debug messages.

Is the trial version limited in some way graphically, like hardware acceleration off, because transitions and scrolling stutters and this is a high end phone.

The
Sanjit

Not that I’m aware of.  There were a bunch of widget fixes in 2481.  The trial is on an older version.  This might have been fixed.

Can you try to provide the parts to do a scroll bar?  Can you try a different widget theme too?  What widget theme are you using?

Thanks

Rob

Hi Rob

The errors went away after I did a widget:settheme(). Also had to download and include the theme png from https://github.com/coronalabs/framework-widget … 

Thanks

Sanjit

What theme are you using?  The core themes for iOS  7/8, iOS 6 and earlier, our older android theme should already be in the core.  The new holo themes will be in the next public build. Perhaps those are the ones you downloaded.

Rob

local widget = require(“widget”)

widget.setTheme( “widget_theme_ios7” )

I have to add widget_theme_ios7.png to the assets folder or else all the runtime errors reappear…

Thx

Sanjit