Comments (24)
Thanks @bruzkovsky I spent long enough just finding the issue, I probably would have blown a brain cell trying to find a workaround myself. 👍
from xamarin.forms.
It's crashing for me on my iPad. I'll take a look at this one and see what I can figure out
from xamarin.forms.
It;s 2020. The latest & greatest VisualStudio, XamForms, etc. This issue (or a similar one) still exists with CollectionView and ObservableCollection. In some scenarios, index out of range occurs -- the same issue as has been reported for 5 years regarding the ListView.
from xamarin.forms.
Fairly confident we've seen this too because the symptoms and cause very closely match your description. In our case it's happening with a MasterDetail where the Detail isn't currently visible by the ItemSource of the ListView is updated.
from xamarin.forms.
@mattclarkie For my case I found a workaround to programmatically show the page before updating the list. Maybe you can to the same with your detail page.
from xamarin.forms.
@Sokoo92 I added my workaround to the description, hope it can help you out...
Anyhow, will we get an update on this soon? @StephaneDelcroix @jassmith
from xamarin.forms.
Probably related to #1927
from xamarin.forms.
Hit by this bug too even with the latest XF 2.5.1.444934
Workaround from @bruzkovsky indeed works but is ugly.
Any ETA for fixing this?
Thanks
from xamarin.forms.
@nbsoftware I Just tested it with 3.0.0.550146 it works.
Could you confirm?
from xamarin.forms.
Nope, still reproducible in 3.0.0.550146
Updated Repro:
FormIOSListViewCrashNew.zip
from xamarin.forms.
@bruzkovsky I have tried all of your attached samples, including the one you provided on your fork (via the Bugzilla ticket), and I cannot get it to crash! I'm wondering if there is another variable that we need to identify. What devices/simulators have you tried recently? What version of VS are you currently on?
from xamarin.forms.
My IDE version info: https://gist.github.com/bruzkovsky/e16cb0b58f81f8b045a426a2406d68ba
I tried with the iPhone 6s Simulator running iOS 11.2 and on my iPad3 Mini.
Did you follow the steps exactly? You could also try to just tap "Add2" first thing after the app starts.
from xamarin.forms.
I can confirm @bruzkovsky's sample does still crash, even with latest XF 3.0.561731.
iPhone 8 Simulator running iOS 11.4
from xamarin.forms.
@nbsoftware Are you also on VS 2017 15.7.1?
I'm using VS 2017 15.7.2 with Xamarin.iOS 11.10.1.178, building on iOS 11.3 SDK with Xcode 9.3 9E145.
I have followed the instructions exactly with the same simulators, but still no luck! I am also unable to reproduce the errors in #1542 or #1927 anymore, and I believe they all have the same root cause.
from xamarin.forms.
I updated to VS 2017 15.7.3 with Xamarin-iOS 11.12.0.4 and can still reproduce the crash. Really strange...
Here is the stack trace:
https://gist.github.com/bruzkovsky/ff216b9c7d6604f5792bede97dad6d07
Also tried it directly on the Mac with VS for Mac 7.5.2, stack trace below:
https://gist.github.com/bruzkovsky/9a3fd2aeb6858bd82a4935a621aca924
from xamarin.forms.
I still get same issue on iPadAir (did not test on other devices)
from xamarin.forms.
Same issue on ios 12.1 and iphone simulator XR...
from xamarin.forms.
Still experiencing same issue with 3.6.0.344457.
Listview binded to ObservableCollection inside a tab page. Throws the same error on the first object added to the collection.
from xamarin.forms.
Same issue here with 4.0.0.425677. ListView inside a Shell Tab. Working without problems on Android.
from xamarin.forms.
@MSiccDev can you try the latest 4.1 pre and if you still have an issue create an issue with a repro?
from xamarin.forms.
@PureWeen before reading your comment, I moved on. I was calling .Clear() on my ObservableCollection(s) before adding new items (as I planned to simply remove items and insert the updated list after that). The collection count was 0, and the error I got indicated that this is a problem on iOS. I moved to a check with .All(vm => vm.Id != whatever.Id), which makes the error disappearing. I am trying to avoid preview packages in the current state as much as I can, but the error happened also with the latest public release of XF. Hope this feedback helps to narrow down the issue.
from xamarin.forms.
@PureWeen, currently using XF version 4.1.0.673156 (latest version) and the issue persists:
Shell Tab App with a CollectionView attached to an Observable Collection.
When calling .Add in my ViewModel the App Crashes:
"UIKit Consistency error: you are calling a UIKit method that can only be invoked from the UI thread."
from xamarin.forms.
@LuisDeHaro you have to call .Add
on the Main Thread, for example by using await Device.InvokeOnMainThreadAsync(() => myObservableCollection.Add(myItem))
from xamarin.forms.
can someone help me i have this same problem.Thanks
from xamarin.forms.
Related Issues (20)
- App freezes on Windows (UWP) when using Frame
- Cannot reload Listview datasource more than once, app close after error, Object reference not set to an instance of an object
- After installing the "Miicrosoft.UI.XAML" NuGet package on UWP platform. The Xamarin Button control style was changed. HOT 2
- [Bug] Xamarin.iOS application crashes on device with test flight version but not with DEBUG version HOT 4
- Unable to build Android custom renderers with latest Xamarin.Forms version HOT 1
- Xamarin Google.Map.MapView crash HOT 1
- [Bug] Missing a crucial warning in the NSMenu.Items documentation. HOT 1
- [Bug] App is frozen when resumed (Android) HOT 1
- UWP camera save option is disabled untill you edit capture picture. HOT 1
- [Bug] Archiving in VS 2022 failing HOT 3
- [Enhancement] Add more descriptive exception for route not found (Shell.Current.GoToAsync). HOT 2
- [Bug] Xamarin Splash screen not visible turns out black in iOS HOT 2
- [Bug] Entry looses focus
- [Bug] DisplayActionSheet doesn't show up on macOS
- [Bug] Letters below the writing line are cut off on iOS
- X2Property binding seems to be unfunctional in a carouselview
- [Bug] Xamarin.Forms v5.0.0.2662 has a package version conflict with itself HOT 5
- [Visual Studio 17.9.3] Xamarin project encountered an issue with xaml
- Get code in app from stack trace
- [Bug] In .Net 8 MAUI VisibleViews property of CarouselView is not working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xamarin.forms.