Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to bind data on my radlistview #270

Closed
dgma7 opened this issue Aug 19, 2017 · 8 comments
Closed

Error when trying to bind data on my radlistview #270

dgma7 opened this issue Aug 19, 2017 · 8 comments

Comments

@dgma7
Copy link

dgma7 commented Aug 19, 2017

Please, provide the details below:

Did you verify this is a real problem

Yes

Tell us about the problem

this issue appears when trying to set data on one of my radlistview, I'm using two radlistview on my page.

*** Assertion failure in -[TKCollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3600.7.47/UICollectionView.m:5781
Aug 19 13:37:04 dulces-iMac com.apple.CoreSimulator.SimDevice.CA5F5C9C-1B9F-4AC1-90E5-D25E7DD049A1.launchd_sim[6335] (UIKitApplication:mx.sicar.sicarapp[0x6a03][6357][10508]): Service exited due to Segmentation fault: 11

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

nativescript │ 3.1.3 │ 3.1.3
tns-core-modules │ 3.1.1 │ 3.1.1
tns-android │ 3.1.1 │ 3.1.1
tns-ios │ 3.1.0 │ 3.1.0

@ginev ginev self-assigned this Aug 21, 2017
@ginev
Copy link
Contributor

ginev commented Aug 21, 2017

@dgmaar - to be able to better assist we would need some more information about the way you are fetching your data and assigning it to RadListView. Can you please share some source here?

@ginev ginev added the listview label Aug 21, 2017
@tsonevn
Copy link

tsonevn commented Dec 6, 2017

closing due to inactivity

@felixkrautschuk
Copy link

felixkrautschuk commented Mar 7, 2018

@tsonevn @ginev I get exactly this error message on iOS, you can have a look at the following sample project:

AssertionFailure.zip

Steps to reproduce:

  1. tap the button to navigate to the list-page

  2. wait until data is loaded (on iOS it takes a while until the items are loaded, see here

  3. navigate back

  4. tap the button and navigate to the list page again.

Note: when I put the clear-functionality of the observable-array into a timeout, the error does not occur, even with 0 ms timeout. But I don't know if this may have side effects, that's why I don't do tit this way.

@tsonevn
Copy link

tsonevn commented Mar 8, 2018

Hi @felix-idf,
Thank you for the sample project.
I tested it on my side, however, the application was build successfully and the binding works as expected after secondary navigation.

Can you check if you are using the latest version of NativeScript CLI 3.4.2? Also, try removing the platform with tns platform remove android and delete node_modules folder. Then rebuild the app tns run android.

@felixkrautschuk
Copy link

Hi @tsonevn ,
thank you for your fast reply.

As @dgmaar already mentioned in this thread, the problem is the iOS platform, not Android (everything works as expected there).

I have NativeScript 3.4.3 installed and I tested this with the iOS simulator: iPhone 6 - iOS 10.3.1.

The following GIF shows steps 3 and 4 of the described scenario until the app crashes:
assertion

*** Assertion failure in -[TKCollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3600.7.47/UICollectionView.m:5569

@felixkrautschuk
Copy link

Thanks for re-opening this issue.

I noticed, that the sample app, the databinding is done a different way:

The viewmodel is is a class that extends the Observable class and you assign a new instance of this ViewModel class as the bindingContext of the page each time in the navigatingTo event of the page.
This way, the error does not occur on iOS...

Apart from the fact, that it would be a huge amount of work to re-write the Viewmodel machanism for all pages in our app, I think it is not resource-friendly to create a new instance of the ViewModel class everytime you navigate to a page, instead of re-using an existing object.

I hope there is another way to overcome this issue.

@anuragd7
Copy link

Hi, Iam facing a similar issue in my nativescript angular project too. The rad list view loads fine, but when I try to delete an item from the list view it fails with the error - *** Assertion failure in -[TKCollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3600.9.1/UICollectionView.m:5569.

Any fixes/ solutions would be highly appreciated.

@radeva radeva added this to the 4.1 milestone Mar 28, 2018
@shivgolani
Copy link

Hello @fakalieva replacing navigatingTo with loaded resolves the bug.

@tgpetrov tgpetrov self-assigned this May 31, 2018
@nsplugins nsplugins modified the milestones: 4.1, 4.2 Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests