xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.64k stars 1.88k forks source link

[Bug] #15731

Closed bikrambhandari48 closed 1 year ago

bikrambhandari48 commented 1 year ago

Description

Xamarin.Forms apps are crashing on iOS 16.4.1 (iPad only). The app was working before 16.4.1. The same app works perfectly fine on iPhones (16.4.1) but keeps on crashing on iPad with the latest version of iOS.

Steps to Reproduce

  1. Create a xamarin forms application.
  2. Run the application on any iPad running iOS 16.4.1. The application crashes with the below message.

Expected Behavior

The app should work and launch without any crashes.

Actual Behavior

The app is crashing when launching the app.

Basic Information

Screenshots

Screenshot 2023-04-27 at 8 19 44 pm

Build logs

objc[11445]: Class CDPKeychainItemDescriptor is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreCDPInternal.framework/CoreCDPInternal (0x163139d28) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreCDP.framework/CoreCDP (0x158b35d28). One of the two will be used. Which one is undefined. objc[11445]: Class CDPCAWalrusReporter is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreCDPInternal.framework/CoreCDPInternal (0x16313a598) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreCDP.framework/CoreCDP (0x158b35f08). One of the two will be used. Which one is undefined. objc[11445]: Class CDPCAReporter is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreCDPInternal.framework/CoreCDPInternal (0x16313a368) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreCDP.framework/CoreCDP (0x158b36138). One of the two will be used. Which one is undefined. objc[11445]: Class CDPRecoveryKeyCache is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreCDPInternal.framework/CoreCDPInternal (0x16313a098) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreCDP.framework/CoreCDP (0x158b361d8). One of the two will be used. Which one is undefined. objc[11445]: Class CDPCABackupRecoveryReporter is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreCDPInternal.framework/CoreCDPInternal (0x16313b268) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreCDP.framework/CoreCDP (0x158b363b8). One of the two will be used. Which one is undefined. objc[11445]: Class NSURLSessionDelegate is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/NetworkServiceProxy.framework/NetworkServiceProxy (0x15eccad48) and /Users/jivanbhandari/Library/Developer/CoreSimulator/Devices/B8A056C1-017D-4723-BE08-E143F9045376/data/Containers/Bundle/Application/AD78B9AF-5FB6-4CE9-91F1-B5A17F84828C/StorefrontRetail.iOS.app/StorefrontRetail.iOS (0x105353388). One of the two will be used. Which one is undefined. MonoTouch: Could not install sigaction override, unexpected sigaction implementation. 2023-04-27 21:52:09.257897+0930 StorefrontRetail.iOS[11445:235222] This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes. Stack:( 0 CoreAutoLayout 0x00000001244e41d9 _AssertAutoLayoutOnAllowedThreadsOnly + 206 1 CoreAutoLayout 0x00000001244e3f52 -[NSISEngine _optimizeWithoutRebuilding] + 54 2 CoreAutoLayout 0x00000001244e3a44 -[NSISEngine optimize] + 92 3 CoreAutoLayout 0x00000001244def19 -[NSISEngine performPendingChangeNotifications] + 82 4 UIKitCore 0x00000001338515a9 -[UIView(Hierarchy) layoutSubviews] + 199 5 UIKitCore 0x0000000133865083 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2313 6 QuartzCore 0x000000011f065d98 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 526 7 QuartzCore 0x000000011f071849 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 65 8 QuartzCore 0x000000011ef8115e _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 624 9 QuartzCore 0x000000011efb7805 _ZN2CA11Transaction6commitEv + 723 10 StorefrontRetail.iOS 0x00000001050bdce9 xamarin_dyn_objc_msgSend + 217 11 ??? 0x00000001705648b2 0x0 + 6179670194 12 ??? 0x00000001700eadb3 0x0 + 6174977459 13 StorefrontRetail.iOS 0x0000000104e77525 mono_jit_runtime_invoke + 1621 14 StorefrontRetail.iOS 0x0000000104f9cf28 mono_runtime_invoke_checked + 136 15 StorefrontRetail.iOS 0x0000000104fa29dd mono_runtime_delegate_try_invoke + 157 16 StorefrontRetail.iOS 0x0000000104feef17 start_wrapper_internal + 647 17 StorefrontRetail.iOS 0x0000000104feec6e start_wrapper + 62 18 libsystem_pthread.dylib 0x0000000123cbb1d3 _pthread_start + 125 19 libsystem_pthread.dylib 0x0000000123cb6bd3 thread_start + 15 ) 2023-04-27 21:52:09.267967+0930 StorefrontRetail.iOS[11445:235222] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.' First throw call stack: ( 0 CoreFoundation 0x000000010f0cb78b __exceptionPreprocess + 242 1 libobjc.A.dylib 0x0000000120989b73 objc_exception_throw + 48 2 CoreAutoLayout 0x00000001244e42b1 -[NSISEngine tryToOptimizeReturningMutuallyExclusiveConstraints] + 0 3 CoreAutoLayout 0x00000001244e3f52 -[NSISEngine _optimizeWithoutRebuilding] + 54 4 CoreAutoLayout 0x00000001244e3a44 -[NSISEngine optimize] + 92 5 CoreAutoLayout 0x00000001244def19 -[NSISEngine performPendingChangeNotifications] + 82 6 UIKitCore 0x00000001338515a9 -[UIView(Hierarchy) layoutSubviews] + 199 7 UIKitCore 0x0000000133865083 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2313 8 QuartzCore 0x000000011f065d98 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 526 9 QuartzCore 0x000000011f071849 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 65 10 QuartzCore 0x000000011ef8115e _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 624 11 QuartzCore 0x000000011efb7805 _ZN2CA11Transaction6commitEv + 723 12 StorefrontRetail.iOS 0x00000001050bdce9 xamarin_dyn_objc_msgSend + 217 13 ??? 0x00000001705648b2 0x0 + 6179670194 14 ??? 0x00000001700eadb3 0x0 + 6174977459 15 StorefrontRetail.iOS 0x0000000104e77525 mono_jit_runtime_invoke + 1621 16 StorefrontRetail.iOS 0x0000000104f9cf28 mono_runtime_invoke_checked + 136 17 StorefrontRetail.iOS 0x0000000104fa29dd mono_runtime_delegate_try_invoke + 157 18 StorefrontRetail.iOS 0x0000000104feef17 start_wrapper_internal + 647 19 StorefrontRetail.iOS 0x0000000104feec6e start_wrapper + 62 20 libsystem_pthread.dylib 0x0000000123cbb1d3 _pthread_start + 125 21 libsystem_pthread.dylib 0x0000000123cb6bd3 thread_start + 15 )

Workaround

Not found. Still waiting.

jfversluis commented 1 year ago

Without a reproduction or at least some relevant code it will be near impossible to diagnose or fix this. Based of the exception message it seems that you are updating a collection from a background thread somewhere.

Closing this for now, if you have a reproduction sample of piece of code where this happens, please open a new issue so we can have a look.