App is crashing while user is in WkWebView

I have a 4.1 xamarin.forms app (but it's been happening for a while) where the user is sent to a web site using a custom web view (on iOS it uses WKWebView). It's only custom so I could render a WKWebView. Anyway, while the user is in this web app it randomly crashes with the following:

SIGABRT: Objective-C exception thrown. Name: NSGenericException Reason: *** Collection <__NSArrayM: 0x283d5aa00> was mutated while being enumerated. Native stack trace: 0 CoreFoundation 0x00000001f5f79294 <redacted> + 252 1 libobjc.A.dylib 0x00000001f51539f8 objc_exception_throw + 56 2 CoreFoundation 0x00000001f5f78b44 <redacted> + 0 3 CameraUI 0x0000000212c73f68 <redacted> + 448 4 CameraUI 0x0000000212c74290 <redacted> + 208 5 CameraUI 0x0000000212cf9080 <redacted> + 128 6 libsystem_blocks.dylib 0x00000001f5a14a44 _Block_release + 152 7 libsystem_blocks.dylib 0x00000001f5a14a44 _Block_release + 152 8 libdispatch.dylib 0x00000001f59b97d4 <redacted> + 16 9 libdispatch.dylib 0x00000001f5962320 <redacted> + 592 10 libdispatch.dylib 0x00000001f5962e3c <redacted> + 428 11 libdispatch.dylib 0x00000001f596b4a8 <redacted> + 596 12 libsystem_pthread.dylib 0x00000001f5b99114 _pthread_wqthread + 304 13 libsystem_pthread.dylib 0x00000001f5b9bcd4 start_wqthread + 4

The web app the user is on allows them to take pictures which works perfectly well outside WKWebView. The user could be filling out part of a form or they could be taking a picture and then it crashes. We've been observing this for some time now, and I cannot see a pattern.

One the user is sent to the WKWebView, the forms app is no longer doing anything. So what could be causing the collection to be mutated?

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    We need the code of your web page and the code how you created the WKWebView, how to manipulate the data after taking pictures.

Sign In or Register to comment.