I am experiencing the same issue where the app crashes when trying to perform:
view.\_fixedGroup:insert( lib.scrollBar )
with the error:
widget_momentumScrolling.lua:829: attempt to call method ‘insert’ (a nil value)
Is anyone trying to fix this?
I am experiencing the same issue where the app crashes when trying to perform:
view.\_fixedGroup:insert( lib.scrollBar )
with the error:
widget_momentumScrolling.lua:829: attempt to call method ‘insert’ (a nil value)
Is anyone trying to fix this?
I ended up removing scrollbar support from my scrollviews as I had so many problems with it. But having learned a lot more about this stuff since I did that…
I think that scrollviews are not really designed to be deleted at all and certainly not immediately after an insert.
When you insert something into a scrollview there are three non obvious things that happen could go horribly wrong if you immediately delete it.
1: There’s a 2ms timer that creates the scrollbar
2: There’s a 1ms timer that recalculates the size of the scroll area
3: There’s a transition with 0 time that scrolls it back to where it should be
I don’t think any of those would be especially pleased if you deleted the scrollview out from under them
Some things that would probably help:
1: don’t use scrollbars on scrollviews
2: call transition.cancel() before trying to remove a scrollview
Depending on what’s doing the creating and removing of the scrollviews you could disable everything that could create new ones whilst you’re deleting old ones, do it on a timer and then reenable it all after it’s done
It’s probably best to try to avoid doing things that might upset it rather than worrying too hard about exactly which bits of it aren’t as well protected as they might be.
Any word on when this will be fixed? My current android game Super Bit Adventure is getting this error on phones when people swipe through the shop too quickly and switch menus. Kind of sad i have to say its out of my hands.
Does this cause an issue in how the code operates? I was under the understanding that it was more of a message that shows up in the console log and really was harmless to operations.
Is this not the case?
Rob
Hi Rob.
No, this error crashes the application.
Hi! We’re also seeing this runtime error, and crash, in our app, any news on this?
Same here, scrollview crashes app on device randomly.
I am experiencing the same issue where the app crashes when trying to perform:
view.\_fixedGroup:insert( lib.scrollBar )
with the error:
widget_momentumScrolling.lua:829: attempt to call method ‘insert’ (a nil value)
Is anyone trying to fix this?
I ended up removing scrollbar support from my scrollviews as I had so many problems with it. But having learned a lot more about this stuff since I did that…
I think that scrollviews are not really designed to be deleted at all and certainly not immediately after an insert.
When you insert something into a scrollview there are three non obvious things that happen could go horribly wrong if you immediately delete it.
1: There’s a 2ms timer that creates the scrollbar
2: There’s a 1ms timer that recalculates the size of the scroll area
3: There’s a transition with 0 time that scrolls it back to where it should be
I don’t think any of those would be especially pleased if you deleted the scrollview out from under them
Some things that would probably help:
1: don’t use scrollbars on scrollviews
2: call transition.cancel() before trying to remove a scrollview
Depending on what’s doing the creating and removing of the scrollviews you could disable everything that could create new ones whilst you’re deleting old ones, do it on a timer and then reenable it all after it’s done
It’s probably best to try to avoid doing things that might upset it rather than worrying too hard about exactly which bits of it aren’t as well protected as they might be.
I encountered this problem with a scrollView containing about 400 objects. It was a refreshable scrollView so I was removing it and re-drawing it every time. I fixed the issue by only calling removeSelf() on the view holding the objects and setting it to nil and then only re-drawing that part.
The hierarchy was a bit like mainView > scrollView > myViewContainingObjects > Objects.
Before I was removing scrollView and re-drawing it every time… now I am leaving the scroll view in place and just re-drawing the view containing my objects.
This seems to have circumvented the crash.
I encountered this problem with a scrollView containing about 400 objects. It was a refreshable scrollView so I was removing it and re-drawing it every time. I fixed the issue by only calling removeSelf() on the view holding the objects and setting it to nil and then only re-drawing that part.
The hierarchy was a bit like mainView > scrollView > myViewContainingObjects > Objects.
Before I was removing scrollView and re-drawing it every time… now I am leaving the scroll view in place and just re-drawing the view containing my objects.
This seems to have circumvented the crash.