WKWebView Crash/Restart while using Capacitor Plugin

Hi –

I’m using recent Capacitor (4.7.3) and Ionic (7.0.3). I’m running the GitHub - WebsiteBeaver/capacitor-document-scanner: A Capacitor document scanner plugin for Android and iOS plugin which does not much more than just run the native VNDocumentCameraViewController() of iOS.

Sometimes the Webkit process crashes and restarts, while scanning. Many times it also works smoothly. One of these bugs which are hard to debug. Could be related to memory issues, because there is a spike in the memory consumption that goes up to 300MB if the VNDocumentCameraViewController resized the scanned image. But the Controller is a Apple thing, so there’s no configuration option at all there.

Anyway, these are the logs:

2023-04-30 15:30:31.773877+0200 App[43992:1786607] [Process] 0x1140680c0 - GPUProcessProxy::didClose:
2023-04-30 15:30:31.782778+0200 App[43992:1786607] [Process] 0x1140680c0 - GPUProcessProxy::gpuProcessExited: reason=Crash
2023-04-30 15:30:31.787708+0200 App[43992:1786607] [Process] 0x115001560 - [PID=43997] WebProcessProxy::gpuProcessExited: reason=Crash
2023-04-30 15:30:31.813484+0200 App[43992:1786607] [Process] 0x115001560 - [PID=43997] WebProcessProxy::didClose: (web process 0 crash)
2023-04-30 15:30:31.813534+0200 App[43992:1786607] [Process] 0x115001560 - [PID=43997] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=Crash
2023-04-30 15:30:31.814954+0200 App[43992:1786607] [ProcessSuspension] 0x114020120 - ProcessAssertion: Failed to acquire RBS Background assertion 'XPCConnectionTerminationWatchdog' for process because PID 0 is invalid
2023-04-30 15:30:31.815307+0200 App[43992:1786784] [ProcessSuspension] 0x114020120 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'XPCConnectionTerminationWatchdog' for process with PID=0, error: (null)
2023-04-30 15:30:31.828713+0200 App[43992:1786607] [Process] 0x105824018 - [pageProxyID=8, webPageID=9, PID=43997] WebPageProxy::processDidTerminate: (pid 43997), reason=Crash
2023-04-30 15:30:31.879828+0200 App[43992:1786607] [Loading] 0x105824018 - [pageProxyID=8, webPageID=9, PID=43997] WebPageProxy::dispatchProcessDidTerminate: reason=Crash
2023-04-30 15:30:31.887244+0200 App[43992:1786889] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
2023-04-30 15:30:31.887304+0200 App[43992:1786889] [ProcessSuspension] 0x114008400 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'NetworkProcess Background Assertion' for process with PID=43996, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
2023-04-30 15:30:31.993030+0200 App[43992:1786607] [Process] 0x115000470 - NetworkProcessProxy::didClose (Network Process 0 crash)
2023-04-30 15:30:31.996294+0200 App[43992:1786607] [ProcessSuspension] ProcessAssertion::remainingRunTimeInSeconds failed to get handle for process with PID=43996
2023-04-30 15:30:35.088578+0200 App[43992:1786607] [Process] 0x115002f40 - [PID=44004] WebProcessProxy::didBecomeUnresponsive:
2023-04-30 15:30:35.088769+0200 App[43992:1786607] [Process] 0x105824018 - [pageProxyID=8, webPageID=9, PID=44004] WebPageProxy::processDidBecomeUnresponsive:

I’m tapping completely in the dark - is there anybody who might clear up this issue a little bit?


You should ask this question in the github repo’s issues section, you may have better luck there.

Im facing the same problem. Have you found any solutions, leads, or workaround?