question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: iOS UI freeze after return from background (After upgrade to capacitor 3)

See original GitHub issue

Bug Report

Capacitor Version

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 3.3.4 @capacitor/core: 3.3.4 @capacitor/android: 3.3.4 @capacitor/ios: 3.3.4

Installed Dependencies:

@capacitor/cli: 3.3.4 @capacitor/core: 3.3.4 @capacitor/android: 3.3.4 @capacitor/ios: 3.3.4

PASTE OUTPUT HERE

Platform(s)

iOS

Current Behavior

iOS UI freeze after returning from the background, while I try to navigate to other pages. (Happens randomly while returning from background) It would be fine if I’m staying on the same page by scrolling, opening modal or side menu. This issue happens after I upgrade to Ionic framework 6 and capacitor 3.

There’s totally no error from xcode / console log and it just freezes the UI. I did trace all errors by using sentry and it doesn’t have any records as well.

Expected Behavior

Before this, the Apps were working just fine.

Other Technical Details

npm --version output: 8.3.0 node --version output: v16.13.0 pod --version output (iOS issues only): 1.11.2 Ionic Info output: Ionic:

Ionic CLI : 6.18.1 Ionic Framework : @ionic/angular 6.0.1 @angular-devkit/build-angular : 13.1.2 @angular-devkit/schematics : 12.2.10 @angular/cli : 13.1.2 @ionic/angular-toolkit : 5.0.3

Capacitor:

Capacitor CLI : 3.3.4 @capacitor/android : 3.3.4 @capacitor/core : 3.3.4 @capacitor/ios : 3.3.4

Utility:

cordova-res : 0.15.4 native-run : 1.5.0

System:

NodeJS : v16.13.0 npm : 8.3.0 OS : macOS Monterey

Additional Context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
jcesarmobilecommented, Feb 11, 2022
1reaction
spasmacommented, Jan 18, 2022

@jcesarmobile I think I’ve stumbled upon the same issue.

Today I’ve managed to get the issue while connected to USB with the debugger on:

2022-01-18 14:40:17.008038+0100 App[29174:6253942] [ProcessSuspension] 0x1070d78a0 - ProcessAssertion: Failed to acquire RBS assertion 'WebProcess Background Assertion' for process with PID=29178, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
2022-01-18 14:40:17.014385+0100 App[29174:6253942] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
2022-01-18 14:40:17.014432+0100 App[29174:6253942] [ProcessSuspension] 0x1070d7960 - ProcessAssertion: Failed to acquire RBS assertion 'WebProcess Foreground Assertion' for process with PID=29178, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
2022-01-18 14:40:17.021049+0100 App[29174:6253942] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
2022-01-18 14:40:17.021091+0100 App[29174:6253942] [ProcessSuspension] 0x1070d7a20 - ProcessAssertion: Failed to acquire RBS assertion 'WebProcess Background Assertion' for process with PID=29389, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
2022-01-18 14:40:17.021682+0100 App[29174:6253942] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
2022-01-18 14:40:17.021722+0100 App[29174:6253942] [ProcessSuspension] 0x1070d7a80 - ProcessAssertion: Failed to acquire RBS assertion 'WebProcess Foreground Assertion' for process with PID=29389, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
2022-01-18 14:40:17.031249+0100 App[29174:6253946] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
2022-01-18 14:40:17.032969+0100 App[29174:6151631] [Process] 0x10a0d0000 - [PID=29389] WebProcessProxy::didClose: (web process 0 crash)
2022-01-18 14:40:17.033071+0100 App[29174:6151631] [Process] 0x10a0d0000 - [PID=29389] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=4

It happens once in a while, on some iOS-devices only. Not older Device-type related, got it on a iPhone 12 of a co-worker today. On my iPhone 12 (same iOS-version) it never happened (yet).

We tried to find why this happened since a while (Capacitor 3 related or ionic related, I wasn’t sure). Found online something about webViewWebContentProcessDidTerminate, which was available in capacitor 2, which reloads the webview if crashed: https://github.com/ionic-team/capacitor/blob/260feebb78d67c431de7831548dfd4271ceb5079/ios/Capacitor/Capacitor/CAPBridgeViewController.swift#L346-L348

It was removed here (in v3): https://github.com/ionic-team/capacitor/commit/581d89cfd9581bec4e99808b810b3dab2741d4eb#diff-dd3e575ae0eaf8c928bf7f907d10f1bb769e01a2dc37093b0e0946b8515f9923L350

I’m not sure, but maybe it’s related. The old app reloaded the WebView when it crashed as a workaround, couldn’t find this webViewWebContentProcessDidTerminate method in the latest code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Capacitor Ios app frozen on Ios after screenlock - Stack Overflow
The problem arises when I close the app, keep it laying for around 5 seconds and then reopen it. However these freezes do...
Read more >
[Resolve]-Capacitor Ios app frozen on Ios after screenlock
It seems like disabling the watches, fetching and the SignalR connection somehow reduces the possibility to freeze the app after coming from the...
Read more >
Crash in background on iOS 15 EXC_CRASH (SIGKILL)
Hello, Since the first iOS 15 beta and even with all the next public releases, we have a very weird crash each time...
Read more >
iOS Troubleshooting Guide | Capacitor Documentation
This guide attempts to document common iOS/Xcode issues with possible solutions. iOS Toolbox​. Every iOS developer learns a few common techniques for debugging ......
Read more >
My Apps keep Freezing After Update to iOS 16/15, How to Fix
Solution 1: Use Tenorshare ReiBoot to Fix the Problem · Solution 2: Clear All Background Apps · Solution 3: Restart Your iPhone ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found