Com.apple.WebKit.WebContent drop 113 error: Could not find the specified service

I am using WKWebView to view custom HTML.

  • Regardless of the HTML content, when testing on a real device, I get the following error Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service 29 seconds after loading WKWebView , sometimes I even get this error twice. Obviously, this is a configuration issue. I checked the cookies as suggested in the Failed to execute com.apple.WebKit.WebContent command , however this will not help.
  • One more question: is there a list of all error codes that may appear in WKWebView
+43
source share
11 answers

Finally solved the problem above. I get errors

  • Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service

Since I did not add the WKWebView object to the view as a subview and tried to call -loadHTMLString:baseURL: on top of it. And only after it was successfully downloaded did I add it to view the subviews - which was completely wrong. The correct solution to my problem:

1. Add a WKWebView object to view the subviews array

2. Call -loadHTMLString:baseURL: for the newly added WKWebView

+29
source

I got this error by loading the http: // URL where the server responded with redirects to https. After changing the url, I go to WKWebView in https: // ... it worked.

+6
source

Maybe this is a completely different situation, but I always got a WebView[43046:188825] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service when opening a web page on the simulator, when a debugger is connected to it .. If I finish the debugger and open the application again, the web page will open just fine. This does not happen on devices.

After spending a whole day trying to figure out what was wrong, I found that if we have a framework called Preferences , UIWebView and WKWebView will not be able to open the web page and the WKWebView error above.

To reproduce this error, simply make a simple application with WKWebView to display the web page. Then create a new framework target and name it “ Preferences . Then import it into the main target and run the simulator again. WKWebView will not be able to open the web page.

So this may be unlikely, but if you have a framework called Preferences , try deleting or renaming it.

Also, if anyone has an explanation for this, please share.

By the way, I was on Xcode 9.2.

+6
source

I also ran into this problem when loading http url in WKWebView in iOS 11, it works great with https.

What worked for me was setting the "Application Transport" parameter in the info.pist file to resolve the heavy load.

 <key>NSAppTransportSecurity</key> <dict> <!--Not a recommended way, there are better solutions available--> <key>NSAllowsArbitraryLoads</key> <true/> </dict> 
+4
source

SWIFT

Ok, I did it in the following order and did not get any error, for example Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service after that, the following code can also help you.

 webView = WKWebView(frame: self.view.frame) self.view.addSubview(self.view.webView) webView.navigationDelegate = self webView.loadHTMLString(htmlString, baseURL: nil) 

Make as an order.

thanks

+1
source

Mine was different again. I configured the user agent like this:

  NSString *jScript = @"var meta = document.createElement('meta'); meta.setAttribute('name', 'viewport'); meta.setAttribute('content', 'width=device-width'); document.getElementsByTagName('head')[0].appendChild(meta);"; WKUserScript *wkUScript = [[WKUserScript alloc] initWithSource:jScript injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES]; 

This caused something on the webpage to lose memory. Not sure why, but deleting it solved the problem for me.

+1
source

In my case, I ran WKWebView and displayed the website. Then (within 25 seconds) I released WKWebView. But 25-60 seconds after starting WKWebView, I received this error message "113". I assume that the system was trying to signal something to WKWebView and could not find it because it was freed.

The fix was to just leave WKWebView selected.

+1
source

Perhaps the method below may be the reason if you install it

 func webView(_ webView: WebView!,decidePolicyForNavigationAction actionInformation: [AnyHashable : Any]!, request: URLRequest!, frame: WebFrame!, decisionListener listener: WebPolicyDecisionListener!) 

ends

 decisionHandler(.cancel) 

default navigationAction.request.url

Hope it works!

0
source

On OS X, you need to make sure Sandbox features are configured correctly to use WKWebView.

This link clarified this to me: https://forums.developer.apple.com/thread/92265

We share in the hope that this will help someone.


Select the project file in the navigator, select "Features", and then make sure that:
* Sandbox app is turned off,
OR
* The application test environment is turned on and outgoing connections (client) are checked.

0
source

Just to help others, I seem to have this problem too if I tried to load a URL that had spaces at the end (it was extracted from user input).

0
source

I had this problem in my iOS 12.4 when calling defineJavascript. I solved this by wrapping the call in DispatchQueue.main.async { }

0
source

Source: https://habr.com/ru/post/1269286/


All Articles