Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.
Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.
Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.
Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.
Created attachment 9076 [details] Project that demonstrates issue When updating an ObservableCollection that is bound to a ListView, an iOS application will always generate an NSInternalConsistencyException: Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (2), plus or minus the number of rows inserted or deleted from that section (1 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out). Similar code (such as the MobileCRM application) on Xamarin.Forms 1.2.x works fine.
I have checked this issue with attached sample but I am not able to deploy successfully on simulator/device. Please check the screencast and let we know if I have missed anything. could you please provide me the new correct sample project? Screencast: http://www.screencast.com/t/ShpStHYx2kE Application Output: https://gist.github.com/Parmendrak/4de4f956ab504c683c66 Environment info: Xamarin Studio 5.5.4 (build 15) Xamarin.Android : 4.20.0.28 (Business Edition) Xcode 6.1 (6602) Xamarin.iOS: 8.4.0.47 (Business Edition) Xamarin.Mac: 1.10.0.18 (Business Edition) Mac OS X 10.9.4
Created attachment 9103 [details] Re-attach with confirmed working build
I had no issues building and deploying. I'm running Xamarin Studio 5.7 if that helps
Thanks Stuart, I have checked this issue with new sample attached in comment 2 and able to run app successfully. I got an exception which is different from yours exception. Screencast : http://www.screencast.com/t/QNoQqXs5w ApplicationOutput: https://gist.github.com/Parmendrak/2c339f2f4927b1848898 Could you please let us know you are getting this exception with device or simulator? If possible please provide us complete environment info, device/simulator info and log and Application Output, so that developer can figure out what's going on from the stack trace. Thanks! Environment info: === Xamarin Studio === Version 5.7 (build 657) Installation UUID: 1a096c6f-0678-402e-89b2-a2c10f7e80e4 Runtime: Mono 3.10.0 ((detached/92c4884) GTK+ 2.24.23 (Raleigh theme) Package version: 310000031 === Apple Developer Tools === Xcode 6.1 (6602) Build 6A1052c === Xamarin.iOS === Version: 8.6.0.36 (Business Edition) Hash: fb82d4e Branch: Build date: 2014-12-16 22:30:17-0500 === Build Information === Release ID: 507000657 Git revision: 012ec6963a2949d3773b96cee5bc4a05dbada096 Build date: 2014-12-16 15:34:30-05 Xamarin addins: 39ab76ee8d2bc1539d561fd800123124d5ee8bdb === Operating System === Mac OS X 10.9.4 Darwin ShrutiMac.local 13.3.0 Darwin Kernel Version 13.3.0 Tue Jun 3 21:27:35 PDT 2014 root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Yes, after Xamarin Studio updated to the latest (5.7 build 652) , I am now seeing the same error as you. Here is output from About: Xamarin Studio Version 5.7 (build 652) Installation UUID: 05118f15-eaf0-49aa-b448-142a23519d31 Runtime: Mono 3.12.0 ((detached/a813491) GTK+ 2.24.23 (Raleigh theme) Package version: 312000068 Apple Developer Tools Xcode 6.1.1 (6611) Build 6A2008a Xamarin.iOS Version: 8.6.0.32 (Indie Edition) Hash: f31ad46 Branch: Build date: 2014-12-12 17:56:03-0500 Xamarin.Android Not Installed Xamarin.Mac Version: 1.11.3.0 (Starter Edition) Build Information Release ID: 507000652 Git revision: 042e44ba92a6a9c46bd2b69b0b4348df43f381ea Build date: 2014-12-11 18:37:24-05 Xamarin addins: 06d3aaafde7f726d508e079c9b297cc9aae4af55 Operating System Mac OS X 10.10.1 Darwin scarnie-mbp.local 14.0.0 Darwin Kernel Version 14.0.0 Fri Sep 19 00:26:44 PDT 2014 root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
However, if you replace the TestListViewModel.LoadData method with the following: void LoadData() { //Rows = new ObservableCollection<Row> (new []{new Row{Name="one"}, new Row{Name="Two"}}); Rows.Clear (); var rows = new ObservableCollection<Row> (new []{new Row{Name="one"}, new Row{Name="Two"}}); foreach (var row in rows) { Rows.Add(row); } } You will receive the NSInternalConsistencyException
Ignore the MethodNotFoundException, which was resolved with 1.3.1 due to incompatibilities with the unified framework. Now the only problem is the NSInternalConsistencyException
I have checked this issue and follow the code mentioned in the comment 6, And I am also getting same exception "NSInternalInconsistencyException". Screencast: http://www.screencast.com/t/YiybqFnvZr Application output: https://gist.github.com/Parmendrak/66ef463246db007ec632 Build Output: https://gist.github.com/Parmendrak/8914365788c20172ce60 Ide Log: https://gist.github.com/Parmendrak/d8b87f5368478960c8a7 Environment info: === Xamarin Studio === Version 5.7 (build 657) Installation UUID: 1a096c6f-0678-402e-89b2-a2c10f7e80e4 Runtime: Mono 3.10.0 ((detached/92c4884) GTK+ 2.24.23 (Raleigh theme) Package version: 310000031 === Apple Developer Tools === Xcode 6.1 (6602) Build 6A1052c === Xamarin.iOS === Version: 8.6.0.36 (Enterprise Edition) Hash: fb82d4e Branch: Build date: 2014-12-16 22:30:17-0500 === Xamarin.Android === Version: 4.20.0.28 (Enterprise Edition) Android SDK: /Users/360_macmini/Desktop/android-sdk-macosx Supported Android versions: 2.1 (API level 7) 2.2 (API level 8) 2.3 (API level 10) 3.1 (API level 12) 4.0 (API level 14) 4.0.3 (API level 15) 4.1 (API level 16) 4.2 (API level 17) 4.3 (API level 18) 4.4 (API level 19) 4.4.87 (API level 20) 5.0 (API level 21) Java SDK: /usr java version "1.7.0_65" Java(TM) SE Runtime Environment (build 1.7.0_65-b17) Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode) === Xamarin.Mac === Version: 1.10.0.18 (Enterprise Edition) === Build Information === Release ID: 507000657 Git revision: 012ec6963a2949d3773b96cee5bc4a05dbada096 Build date: 2014-12-16 15:34:30-05 Xamarin addins: 39ab76ee8d2bc1539d561fd800123124d5ee8bdb === Operating System === Mac OS X 10.9.4 Darwin ShrutiMac.local 13.3.0 Darwin Kernel Version 13.3.0 Tue Jun 3 21:27:35 PDT 2014 root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Should be fixed in 1.3.2-pre1
I confirmed 1.3.2.6299-pre1 fixed the problem for me here: https://github.com/JohnMichaelHauck/XamarinFormsBug01/commit/e10d9436ae0d6e1002e3aca41f034efd3d179dee
I have checked this issue with Xamarin.Forms 1.3.2.6299-pre1 and now Its working fine. Hence closing this issue.
Hi, this bug is occuring again in XF 2.3.4.224, I reverted back to 2.3.3.193 and it's working fine. Bug appeared after updating.
As with arx iT I'm also having this problem again with the latest version of Forms. =( Anyone know a workaround I haven't been able to find one?
Hi @Kyle, just updated to XF 2.4.0.282. Got this stack trace in the simulator. Any ideas? Unhandled Exception: Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (1 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out). Native stack trace: 0 CoreFoundation 0x0000000112e9cd85 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x00000001139a8deb objc_exception_throw + 48 2 CoreFoundation 0x0000000112e9cbea +[NSException raise:format:arguments:] + 106 3 Foundation 0x000000010c662d5a -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198 4 UIKit 0x000000010adac4ca -[UITableView _endCellAnimationsWithContext:] + 15146 5 HRoWorkAppiOS 0x000000010a004b29 xamarin_dyn_objc_msgSend + 217 6 ??? 0x00000001261e45d2 0x0 + 4934485458 occurred
I'm experiencing same issue with Xamarin.Forms 2.4.0.18342. I partially solved not using ObservableCollection where i could and avoiding "Clear()" function on ObservableCollections, using instead something like: while(myCollection.Count > 0) myCollection.RemoveAt(0); Hope this helps someone, and hope this will be soon fixed because this is a big error! Regards
Please refer to https://bugzilla.xamarin.com/show_bug.cgi?id=59896.
I'm also seeing this on Xamarin Forms 2.5.0.121934. Any updates?
We have this issue using Xamarin.Forms 2.5.0.91635 Any idea how to temporary workaround this?
I have the same issue in a different way. I have A tabbed page and I have the same view in both of them with different data binding source (AllData and Favorites) I do two tests and one fails: 1) - Open the app - Make directly a change from the alldata listview to the favorites listvew (click on the add to favorites button) This one CRUSHES 2) - Open the app - Click on the favorites tab - Click back on the alldata tab - Make a change as previous. This one works and I don't understand why. I have saved the two objects in App and I use the App class to update the objects. With the version 2.3.4.270 it is working great!!
Experiencing this too and tried upgrading Xamarin Forms but to no avail. both versions (that didn't work): 2.3.4.247 & 2.5.0.280555