pichillilorenzo / flutter_inappwebview

A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.
https://inappwebview.dev
Apache License 2.0
3.07k stars 1.38k forks source link

[HeadlessInAppWebView] Error Domain=RBSServiceErrorDomain Code=1 on iOS 15.2 #1075

Open crazecoder opened 2 years ago

crazecoder commented 2 years ago
InAppWebView - dealloc
PullToRefreshControl - dealloc
[assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>
[ProcessSuspension] 0x10e9f8ba0 - ProcessAssertion: Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=3743, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
github-actions[bot] commented 2 years ago

πŸ‘‹ @crazecoder

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

anderson-oki commented 2 years ago

I am having this issue and i'm not using the inappwebview. I wonder if it is related?

lan2000 commented 2 years ago

I have the same problem.

flutter_inappwebview 5.3.2

log

FlutterWebViewController - dealloc
LeakAvoider - dealloc
InAppWebViewMethodHandler - dealloc
PullToRefreshControl - dealloc
InAppWebView - dealloc
[assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>
[ProcessSuspension] 0x10a6f9380 - ProcessAssertion: Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=784, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
[βœ“] Flutter (Channel stable, 2.10.0, on macOS 11.6 20G165 darwin-x64, locale zh-Hans-CN)
    β€’ Flutter version 2.10.0 at /Users/admin/flutter
    β€’ Upstream repository https://github.com/flutter/flutter/
    β€’ Framework revision 5f105a6ca7 (8 days ago), 2022-02-01 14:15:42 -0800
    β€’ Engine revision 776efd2034
    β€’ Dart version 2.16.0
    β€’ DevTools version 2.9.2
    β€’ Pub download mirror https://pub.flutter-io.cn
    β€’ Flutter download mirror https://storage.flutter-io.cn

[βœ“] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    β€’ Android SDK at /Users/admin/android/sdk
    β€’ Platform android-30, build-tools 32.0.0
    β€’ ANDROID_HOME = /Users/admin/android/sdk
    β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    β€’ All Android licenses accepted.

[βœ“] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ CocoaPods version 1.10.0

[βœ—] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[βœ“] Android Studio (version 2021.1)
    β€’ Android Studio at /Applications/Android Studio.app/Contents
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart
    β€’ Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[βœ“] Connected device (1 available)
    β€’ XXX iPad (mobile) β€’ 30b361fa0d77c8f3358d86e61b300fc0b819028b β€’ ios β€’ iOS 15.3 19D50
Wizzel1 commented 2 years ago

Any updates on this?

vatsaltanna commented 2 years ago

I am facing this error too. any update on this ?

Kashifalaliwala commented 2 years ago

Any updates?

amitrotner commented 2 years ago

Any updates? I'm getting this error too in InAppWebView (I'm not using HeadlessInAppWebView) and this leads to a blank white page instead of the requested page. Moreover, it happens randomly - sometimes it works as expected and load the requested page and sometimes I get this error.

kraa commented 2 years ago

Any updates? I'm getting this error in InAppWebView without using HeadlessInAppWebView

arneke commented 2 years ago

I've stopped using a global key for the webview. (On reviewing, I do use global keys, but I create a new one for each generation.)

Afaict inappwebview (or the underlying webview for that matter) doesn't notice when the view (or some part of it, there are multiple processes) gets garbage collected due to the device going to sleep etc. I don't think there's a way to prevent it either.

You get the white page when the render process associated with the webview has been killed.

Since I use bloc I increment a "generation" counter which causes the builder to create a new inappwebview. I do this whenever I detect a problem, so the user gets a new webview quickly. For a smooth user experience this requires that you maintain most of the state outside of the webview, and that you have a way to transfer the state back into the webview.

I did all my testing on Flutter 2.x, not re-tested all the problems after upgrading to 3.x

Zeming404 commented 2 years ago

I've stopped using a global key for the webview.

Afaict inappwebview (or the underlying webview for that matter) doesn't notice when the view (or some part of it, there are multiple processes) gets garbage collected due to the device going to sleep etc. I don't think there's a way to prevent it either.

You get the white page when the render process associated with the webview has been killed.

Since I use bloc I increment a "generation" counter which causes the builder to create a new inappwebview. I do this whenever I detect a problem, so the user gets a new webview quickly. For a smooth user experience this requires that you maintain most of the state outside of the webview, and that you have a way to transfer the state back into the webview.

I did all my testing on Flutter 2.x, not re-tested all the problems after upgrading to 3.x

The webview seems to be deallocated when error occurs so the onLoadError method is not called. How do you detect problems?

arneke commented 2 years ago

Implementing androidOnRenderProcessGone and iosOnWebContentProcessDidTerminate , and have them trigger mapGenerationCubit.increment() probably covers 95% of the cases.

My app frequently sends updates to the webview, so I also have watchdog timer there. Every time I send a message to the webview, if I don't see an ack within X seconds I start over.

Zeming404 commented 2 years ago

Implementing androidOnRenderProcessGone and iosOnWebContentProcessDidTerminate , and have them trigger mapGenerationCubit.increment() probably covers 95% of the cases.

My app frequently sends updates to the webview, so I also have watchdog timer there. Every time I send a message to the webview, if I don't see an ack within X seconds I start over.

Thanks! In my case iosOnWebContentProcessDidTerminate is not called. The problem occurs high frequently after the app launches in release mode on Flutter 3.0.1. When I switch tab and back to the webview, all content show without loading progress. It acts normally in debug or profile mode.

arneke commented 2 years ago

(No need to quote when you are replying to the comment directly above.)

I think you need a physical device not attached to power to trigger this. Lock the screen and wait 30 sec.

If you run the iOS simulator the webview process is visible in mac os, so you can kill it manually to simulate.

Zeming404 commented 2 years ago

I will try it. It's odd that If I run directly in vscode on my iphone xr, it's hard to reproduce the problem. But if I build general app through fastlane, the problem is easy to reproduce.

jigarandrutter commented 1 year ago

Any solution yet on this?

Jai05-techie commented 1 year ago

Hello Team, Any solution to this?

Facing the same issue on iOS 16.0.2 devices. It's happening only in the builds. The page goes blank white.

FlutterWebViewController - dealloc LeakAvoider - dealloc InAppWebViewMethodHandler - dealloc InAppWebView - dealloc PullToRefreshControl - dealloc [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}> [ProcessSuspension] 0x11601c720 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=3814, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}

[βœ“] Flutter (Channel stable, 3.3.10, on macOS 12.6 21G115 darwin-arm (Rosetta), locale en-IN) β€’ Flutter version 3.3.10 on channel stable at /Users/jk/Documents/developer/flutter β€’ Upstream repository https://github.com/flutter/flutter.git β€’ Framework revision 135454af32 (7 weeks ago), 2022-12-15 07:36:55 -0800 β€’ Engine revision 3316dd8728 β€’ Dart version 2.18.6 β€’ DevTools version 2.15.0

[βœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1) β€’ Android SDK at /Users/jk/Library/Android/sdk β€’ Platform android-33, build-tools 33.0.0-rc1 β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java β€’ Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763) β€’ All Android licenses accepted.

[βœ“] Xcode - develop for iOS and macOS (Xcode 14.0.1) β€’ Xcode at /Applications/Xcode.app/Contents/Developer β€’ Build 14A400 β€’ CocoaPods version 1.11.3

[βœ“] Chrome - develop for the web β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[βœ“] Android Studio (version 2021.1) β€’ Android Studio at /Applications/Android Studio.app/Contents β€’ Flutter plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter β€’ Dart plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart β€’ Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[βœ“] VS Code (version 1.74.3) β€’ VS Code at /Applications/Visual Studio Code.app/Contents β€’ Flutter extension can be installed from: πŸ”¨ https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[βœ“] Connected device (3 available) β€’ JK's iPhone (mobile) β€’ ios β€’ iOS 16.0.2 20A380 β€’ macOS (desktop) β€’ macos β€’ darwin-arm64 β€’ macOS 12.6 21G115 darwin-arm (Rosetta) β€’ Chrome (web) β€’ chrome β€’ web-javascript β€’ Google Chrome 109.0.5414.119

holailusoria commented 1 year ago

Any solution of this?

Chirag-kalsariya commented 1 year ago

Facing same issue

Cotspheer commented 1 year ago

Same here, on my side this happens in combination using Azure B2C on the InAppWebView and users try to "Sign in with Apple". So this is kinda mission critical as it prevents users from signing in. Upgrading to the latest beta version and enabling "Background processing" within "Background modes" on "Signing & Capabilities" in Xcode did help. Recent iOS-Updates did change something so my assumption is that the underlaying WebKit implementation now recognises apple.com URLs and tries to launch the native "Sign in with Apple" flow. I'm 100% sure that this was not the case couple months ago and our users were redirected within the web view to Apples Web-OAuth-Flow.

Changed version from _flutterinappwebview: ^5.7.1+2 to _flutterinappwebview: 6.0.0-beta.22. Not sure what's the key difference in 6.0.0, so maybe a dependency was updated or a bug was fixed that lead to the disposal of the WebView.

Anyhow, after the changes the native "Sign in with Apple" is launched properly and the WebView continues when getting redirected. Before it lead to an "onLoadError" call what basically ended the journey.

Flutter doctor -v:

[βœ“] Flutter (Channel stable, 3.7.7, on macOS 13.0.1 22A400 darwin-arm64, locale en-CH)
    β€’ Flutter version 3.7.7 on channel stable at /Users/thomas/Flutter
    β€’ Upstream repository https://github.com/flutter/flutter.git
    β€’ Framework revision 2ad6cd72c0 (5 days ago), 2023-03-08 09:41:59 -0800
    β€’ Engine revision 1837b5be5f
    β€’ Dart version 2.19.4
    β€’ DevTools version 2.20.1

[βœ—] Android toolchain - develop for Android devices
    βœ— Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[βœ“] Xcode - develop for iOS and macOS (Xcode 14.1)
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Build 14B47b
    β€’ CocoaPods version 1.11.3

[βœ“] Chrome - develop for the web
    β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed)
    β€’ Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[βœ“] VS Code (version 1.75.1)
    β€’ VS Code at /Applications/Visual Studio Code.app/Contents
    β€’ Flutter extension version 3.58.0

[βœ“] Connected device (3 available)
    β€’ iPhone (mobile) β€’ 00008030-001D54393C3A802E β€’ ios            β€’ iOS 16.3.1 20D67
    β€’ macOS (desktop) β€’ macos                     β€’ darwin-arm64   β€’ macOS 13.0.1 22A400 darwin-arm64
    β€’ Chrome (web)    β€’ chrome                    β€’ web-javascript β€’ Google Chrome 111.0.5563.64

[βœ“] HTTP Host Availability
    β€’ All required HTTP hosts are available
SamerOrfali22 commented 1 year ago

any solution ?

juanektbb commented 11 months ago

Any updates on this?

aaronbalthaser commented 10 months ago

I am getting the same issue and I wasn't even aware I was using a Webviewe. Does anyone know if it is ok to have these issues in the app. Will this cause memory leaks or any other problems with a production application?

FlutterWebViewController - dealloc LeakAvoider - dealloc InAppWebViewMethodHandler - dealloc InAppWebView - dealloc PullToRefreshControl - dealloc

minh-dai commented 7 months ago

+1

scuti-dai commented 7 months ago

flutter_inappwebview: 5.8.0. dart: ">=3.1.0 <4.0.0" flutter: ">=3.13.0"

error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}

YaKun-SH commented 7 months ago

ε―Όε…₯webview_flutter: ^4.4.2后,APP启动就ζŠ₯ι”™ [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}> [ProcessSuspension] 0x138004120 - ProcessAssertion: Failed to acquire RBS assertion 'WebProcess Background Assertion' for process with PID=26468, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}

stngcoding commented 2 weeks ago

This problem occur when I'm dispose the widget that contain inappwebview before the it can display @pichillilorenzo