I am working on Xamarin.forms application. I have implemented google firebase crashlytics to track down the crashes. I have been facing one crash frequently in IOS. The title of the crash is "xamarin_find_protocol_wrapper_type, SIGABRT ABORT 0x00000001c7a06558". Here is a track trace that I am getting from the firebase. I don't know the reason and way to reproduce.
Crashed: Thread Pool Worker
0 libsystem_kernel.dylib 0x7558 __pthread_kill + 8
1 libsystem_pthread.dylib 0x7118 pthread_kill + 268
2 libsystem_c.dylib 0x1d178 abort + 180
3 RHHMobile.iOS 0x3273ea0 xamarin_find_protocol_wrapper_type + 1189 (runtime.m:1189)
4 RHHMobile.iOS 0x313a944 mono_invoke_unhandled_exception_hook + 1299 (exception.c:1299)
5 RHHMobile.iOS 0x31e898c mono_thread_internal_unhandled_exception + 6010 (threads.c:6010)
6 RHHMobile.iOS 0x31e0004 worker_callback + 392 (threadpool.c:392)
7 RHHMobile.iOS 0x31dd810 worker_thread + 502 (threadpool-worker-default.c:502)
8 RHHMobile.iOS 0x31e8fa4 start_wrapper_internal + 1289 (threads.c:1289)
9 RHHMobile.iOS 0x31e8e28 start_wrapper + 1310 (threads.c:1310)
10 libsystem_pthread.dylib 0x16b8 _pthread_start + 148
11 libsystem_pthread.dylib 0xb88 thread_start + 8
If you cannot reproduce the issue while debugging, it is likely a linking issue. One solution is to add
[Preserve(AllMembers=true)]attribute to the top of all your iOS project classes and common Xamarin classes (Models, ViewModels).Afterwards, add a
LinkerKeep.xmlfile in your iOS project with the following code:Then, set the file as LinkDescription. You can right-click on the LinkerKeep.xml file and select "Build Action" and set it to BundleResource. Alternatively, you can add this property inside
<ItemGroups>in your Xamarin.iOS project file:<LinkDescription Include="LinkerKeep.xml" />This should take care of any linking issue you may have.