Xamarin Forms - Rad ListView iOS 16

0 Answers 137 Views
ListView - Xamarin.iOS
Elvin
Top achievements
Rank 1
Elvin asked on 06 Jun 2023, 09:25 PM

Hi,

List view is not rendering on the iphone/Simulator with iOS 16

When i try to load it on ipad with ios14, it was working fine.

I see below errors in output when debugging in VS2022

*** Assertion failure in -[TKCollectionView _Bug_Detected_In_Client_Of_UICollectionView_Invalid_Batch_Updates:], UICollectionView.m:10064
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid batch updates detected: the number of sections and/or items returned by the data source before and/or after performing the batch updates are inconsistent with the updates.

Please advise if this is known issue.

Xamarin Control Version - 2021.1.413.0

iOS SDK - 16.4/15.5

Thank you

Balwinder

Didi
Telerik team
commented on 07 Jun 2023, 04:52 AM

Hello, 

Are you using the Telerik ListView LoadOnDemand feature? I need more details on your setup and what are the exact steps to reproduce the issue? Sample project, page definition could be of help.

Also you are using version from 2021. Please update to the latest one and check whether the behavior occurs

Elvin
Top achievements
Rank 1
commented on 07 Jun 2023, 03:41 PM | edited

Hi,

Same build (App store) is working fine in iOS 14 but not in later version.

Yes, we are using "EventToCommandBehavior" as per example from "Telerik_UI_for_Xamarin_2021_1_413_1_Dev"

ProjectList.zip file is 2 files from the project (i can't share the whole project)

but second zip file is example from "Telerik_UI_for_Xamarin_2021_1_413_1_Dev" which i followed to implement this in our project.

Updating to new version is not free. So I am not sure if this is viable for us at this moment to upgrade.

Thanks

Ves
Telerik team
commented on 12 Jun 2023, 01:39 PM

Hi,

Thank you for the additional details. Indeed, I was able to reproduce the issue as described. Please, find attached an example, based on your page (I have commented out some code) using the LoadOnDemand Event approach. I tested it with the version you have specified. I hope this helps.

Best regards,

Ves

Elvin
Top achievements
Rank 1
commented on 12 Jun 2023, 01:59 PM

HI,

If I understood it correctly, you commented out main functionality of out app to make it working.

the commented out code shows extra information for that item. Will it work if I uncomment the code?

Second, I was following the example you provided above but there was some reason(don't remember what was it) that I need to go with current implementation. Because it behaves differently when we load from the database vs loop in the memory.

I will try but I doubted.

Thanks for the help. 

Elvin
Top achievements
Rank 1
commented on 14 Jun 2023, 08:42 PM

Hi, 

I have tried with different options but nothing worked.

Thanks

Ves
Telerik team
commented on 15 Jun 2023, 08:08 AM

Hi Elvin,

What I have done there is this: Removed the unrelated code, including such code, which would not build on my side. Then I verified the issue existed as described, still using ListViewLoadOnDemandCollection. So I logged a bug in our public feedback portal and updated your Telerik points. Then I switched the implementation to alternative approach -- LoadOnDemand event and it worked as expected. That's why I suggested this approach. Can you please, confirm if the project I sent, works for you? You can use it as a basis and start adding features back or you add your viewmodel and enhance it so that it matches your setup.

Ves
Telerik team
commented on 15 Jun 2023, 12:37 PM

Hi Elvin,

Upon further investigation, it seems that the issue is present in certain scenarios which involve PullToRefresh too. As a temporary measure, can you please disable the PullToRefresh feature, to verify if this will eliminate it for the time being?

Best regards,

Ves

Elvin
Top achievements
Rank 1
commented on 06 Jul 2023, 03:48 PM

Hi,

We haven't get chance to update as per suggestion but I found out that if we are loading more than one record then the issue occurs.

If you can tell us when this issue will be fixed, may be we can think of purchasing that version of new controls.

Thanks

Ves
Telerik team
commented on 07 Jul 2023, 03:43 PM

Hi Elvin,

The fix is planned for  2023 R2 SP release, expected within two weeks time from today. Let me know if I can be of a further help.

Best regards,

Ves

Elvin
Top achievements
Rank 1
commented on 20 Oct 2023, 04:51 PM

Hi Ves,

 

Can you please let me know if this has made to 2023R2 SP?

 

Thanks

Didi
Telerik team
commented on 23 Oct 2023, 07:24 AM

Elvin
Top achievements
Rank 1
commented on 30 Oct 2023, 05:34 PM

Hi,

We are trying trial version of MAUI .net7 controls and still getting same error on the List. See below an exception which we receive.

 

ObjCRuntime.ObjCException
  Message=Objective-C exception thrown.  Name: NSInternalInconsistencyException Reason: Invalid batch updates detected: the number of sections and/or items returned by the data source before and after performing the batch updates are inconsistent with the updates.
Data source before updates = { 1 section with item counts: [5] }
Data source after updates = { 1 section with item counts: [5] }
Updates = [
Insert item (0 - 0),
Insert item (0 - 1),
Insert item (0 - 2),
Insert item (0 - 3),
Insert item (0 - 4)
]
Collection view: <TKCollectionView: 0x11f462400; baseClass = UICollectionView; frame = (0 0; 393 720.333); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x600000d2f480>; backgroundColor = UIExtendedGrayColorSpace 0 0; layer = <CALayer: 0x6000043ee6c0>; contentOffset: {0, 0}; contentSize: {393, 583}; adjustedContentInset: {0, 0, 0, 0}; layout: <TKListViewLinearLayout: 0x1102fe790>; dataSource: <Telerik_Maui_Controls_Compatibility_DataControlsRenderer_iOS_TKExtendedListView: 0x12b3228f0; frame = (0 0; 393 720.333); backgroundColor = UIExtendedGrayColorSpace 0 0; layer = <CALayer: 0x6000043ee4a0>>>
Native stack trace:
0   CoreFoundation                      0x00007ff80049928d __exceptionPreprocess + 242
1   libobjc.A.dylib                     0x00007ff800063894 objc_exception_throw + 48
2   Foundation                          0x00007ff800daec80 _userInfoForFileAndLine + 0
3   UIKitCore                           0x00007ff804fb10a7 -[UICollectionView _Bug_Detected_In_Client_Of_UICollectionView_Invalid_Batch_Updates:] + 115
4   UIKitCore                           0x00007ff804fb02bc -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:collectionViewAnimator:] + 13332
5   UIKitCore                           0x00007ff804fabfec -[UICollectionView _updateRowsAtIndexPaths:updateAction:updates:] + 492
6   UIKitCore                           0x00007ff804fac0d2 -[UICollectionView insertItemsAtIndexPaths:] + 64
7   Parachute.SaaS.Mobile               0x000000010e4c04de -[TKCollectionView insertItemsAtIndexPaths:] + 126
8   Parachute.SaaS.Mobile               0x000000010e4b049c __38-[TKListView insertItemsAtIndexPaths:]_block_invoke + 76
9   UIKitCore                           0x00007ff80623047f +[UIView _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 593
10  UIKitCore                           0x00007ff806230b1e +[UIView(UIViewAnimationWithBlocks) animateWithDuration:animations:] + 35
11  Parachute.SaaS.Mobile               0x000000010e4b03ce -[TKListView insertItemsAtIndexPaths:] + 334
12  libxamarin-dotnet-debug.dylib       0x000000010f33f26c xamarin_dyn_objc_msgSendSuper + 220
13  ???                                 0x000000010ec7cca7 0x0 + 4542942375
14  libmonosgen-2.0.dylib               0x00000001106d13da ves_pinvoke_method + 474
15  libmonosgen-2.0.dylib               0x00000001106c3655 interp_exec_method + 3717
16  libmonosgen-2.0.dylib               0x00000001106d3094 interp_entry + 420
17  libmonosgen-2.0.dylib               0x00000001106d38c7 interp_entry_static_1 + 55
18  ???                                 0x000000010ed359e0 0x0 + 4543699424
19  libdispatch.dylib                   0x00007ff800166ac0 _dispatch_main_queue_drain + 1420
20  libdispatch.dylib                   0x00007ff800166526 _dispatch_main_queue_callback_4CF + 31
21  CoreFoundation                      0x00007ff8003f5850 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
22  CoreFoundation                      0x00007ff8003f018b __CFRunLoopRun + 2463
23  CoreFoundation                      0x00007ff8003ef409 CFRunLoopRunSpecific + 557
24  GraphicsServices                    0x00007ff80fcdd187 GSEventRunModal + 137
25  UIKitCore                           0x00007ff805b703a2 -[UIApplication _run] + 972
26  UIKitCore                           0x00007ff805b74e10 UIApplicationMain + 123
27  libxamarin-dotnet-debug.dylib       0x000000010f2f964a xamarin_UIApplicationMain + 58
28  libmonosgen-2.0.dylib               0x00000001106d25a9 do_icall + 345
29  libmonosgen-2.0.dylib               0x00000001106d10b3 do_icall_wrapper + 291
30  libmonosgen-2.0.dylib               0x00000001106c34af interp_exec_method + 3295
31  libmonosgen-2.0.dylib               0x00000001106c0e03 interp_runtime_invoke + 259
32  libmonosgen-2.0.dylib               0x00000001104e60e8 mono_runtime_invoke_checked + 136
33  libmonosgen-2.0.dylib               0x00000001104ee0fc do_exec_main_checked + 92
34  libmonosgen-2.0.dylib               0x000000011061cce2 mono_jit_exec + 354
35  libxamarin-dotnet-debug.dylib       0x000000010f33dc77 xamarin_main + 1927
36  Parachute.SaaS.Mobile               0x000000010e5ef014 main + 68
37  dyld                                0x000000010ebe03ee start_sim + 10
38  ???                                 0x000000011d0d241f 0x0 + 4782367775

  Source=<unknown>
  StackTrace:
   at TelerikUI.TKListView.InsertItems(NSIndexPath[] indexPaths)
   at Telerik.Maui.Controls.Compatibility.DataControlsRenderer.iOS.ListViewBatchUpdates.ApplyChanges()
   at Telerik.Maui.Controls.Compatibility.DataControlsRenderer.iOS.TKExtendedListView.<ScheduleBatchUpdates>b__44_0()
   at Telerik.Maui.Controls.RadDispatcher.<>c__DisplayClass8_0.<ProcessItemsInQueue>b__0()
   at Microsoft.Maui.Dispatching.Dispatcher.<>c__DisplayClass9_0.<DispatchImplementation>b__0()
   at CoreFoundation.DispatchQueue.static_dispatcher_to_managed(IntPtr context)
   at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName)
   at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass)
   at Parachute.SaaS.Mobile.Program.Main(String[] args) in C:\Projects\dropzonecdm\Parachute.SaaS.Mobile\Platforms\iOS\Program.cs:line 13
Didi
Telerik team
commented on 31 Oct 2023, 06:53 AM

Hi Elvin,

Could you please share what is the Telerik MAUI version you use and a sample setup in which the behavior occurs? 

No answers yet. Maybe you can help?

Tags
ListView - Xamarin.iOS
Asked by
Elvin
Top achievements
Rank 1
Share this question
or