ios 为什么我收到控制台警告:[Process] kill() 在 iOS13.2 中加载 WKWebView 时返回了意外错误 1?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/58321114/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why I get the console warning: [Process] kill() returned unexpected error 1 when I load a WKWebView in iOS13.2?
提问by Leemur
Since I installed the iOS 13.2 beta, I have been getting a debug console error message. It happens every time I load a ViewController with a WKWebView object in the storyboard.
自从我安装了iOS 13.2 beta以来,我一直收到调试控制台错误消息。每次我在情节提要中加载带有 WKWebView 对象的 ViewController 时都会发生这种情况。
Then the following message is shown continuously while the web view is visible ...
然后在网络视图可见时连续显示以下消息...
2019-10-10 12:10:47.867830+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:47.908698+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:47.908814+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:47.934169+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:47.947668+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:47.964375+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:48.193556+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:48.193723+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:48.193941+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:48.194012+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:48.195679+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:48.200432+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:48.207225+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:48.207298+0200 (...) [Process] kill() returned unexpected error 1
At the moment I close the view I get the following message:
在我关闭视图的那一刻,我收到以下消息:
2019-10-10 12:32:41.577505+0200 (...)[ProcessSuspension] 0x1051e50b0 - ProcessAssertion::processAssertionWasInvalidated()
Sometimes I get the following message in the middle while the web view is loaded: (I can't say when it happens)
有时我会在加载 web 视图时在中间收到以下消息:(我不能说它何时发生)
2019-10-10 12:33:11.453528+0200 (...) Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2019-10-10 12:33:11.459713+0200 (...) Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service
And the if I touch the screen it starts again
如果我触摸屏幕,它会再次启动
2019-10-10 12:10:48.200432+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:48.207225+0200 (...) [Process] kill() returned unexpected error 1
2019-10-10 12:10:48.207298+0200 (...) [Process] kill() returned unexpected error 1
...
I have checked that this is happening in all of the view controller with WKWebViews of my app, so it doesn't seems to be a code error.
我已经用我的应用程序的 WKWebViews 检查了所有视图控制器中都发生了这种情况,因此它似乎不是代码错误。
This doesn't crash the app, but I would like to know why this is happening, and if someone else is having the same issue.
这不会使应用程序崩溃,但我想知道为什么会发生这种情况,以及其他人是否遇到同样的问题。
采纳答案by Rox Dorentus
It's a bug in WebKit (or the underlying OS itself). And no, it was notfixed in 13.[2,3] release.
这是 WebKit(或底层操作系统本身)中的一个错误。不,它没有在 13.[2,3] 版本中修复。
see:
看:
- https://bugs.webkit.org/show_bug.cgi?id=202173
- https://www.mail-archive.com/[email protected]/msg146193.html
- https://bugs.webkit.org/show_bug.cgi?id=202173
- https://www.mail-archive.com/[email protected]/msg146193.html
Update:
更新:
It's fixed in 13.4 release.
它已在 13.4 版本中修复。
回答by TuaimiAA
As in the accepted answer, this is a WebKit bug and it seems that it has been fixed but not released up until the latest iOS release 13.2.2 (at the time of writing this answer)has been fixed in iOS 13.4.
正如在接受的答案中一样,这是一个 WebKit 错误,它似乎已被修复,但直到最新的 iOS 版本 13.2.2(在撰写此答案时)已在 iOS 13.4 中修复后才发布。
As a workaround, however, you can disable/hide the logs temporarily as mentioned in an answer by @iDevzilla:
但是,作为一种解决方法,您可以按照@iDevzilla 的回答中所述暂时禁用/隐藏日志:
1- From Xcode menu open: Product > Scheme > Edit Scheme
1- 从 Xcode 菜单打开:产品 > 方案 > 编辑方案
2- On your Environment Variables set OS_ACTIVITY_MODE
= disable
2- 在您的环境变量集OS_ACTIVITY_MODE
=disable
This will ONLY hide the logs so you can continue developing and testing on iOS. As some indicated, this problem crashes their apps no matter what (for me it is not until now). Also, be careful using this method as it might hide important error messages!
这只会隐藏日志,以便您可以继续在 iOS 上进行开发和测试。正如一些人指出的那样,这个问题无论如何都会使他们的应用程序崩溃(对我来说直到现在还没有)。此外,使用此方法时要小心,因为它可能会隐藏重要的错误消息!
回答by balslev
iOS 13.4 has removed this error! Hurray!
iOS 13.4 已移除此错误!欢呼!
回答by Daniel Danielecki
Update as of 28 March 2020
截至 2020 年 3 月 28 日的更新
Finally Apple deployed something, which not only doesn't shows the error in the logs, but actually allows us; developers to compile, run and submit an application.
最后Apple部署了一些东西,它不仅没有在日志中显示错误,而且实际上允许我们;开发人员编译、运行和提交应用程序。
Especially, if it's you're coming with Cordova/PhoneGap app combined with any HTML5/JavaScript framework/game (Ionic/Phaser) which wants to run on iOS as web wrapper (my personal experience related to this issue) by using WebView. However, not sure if the same issue applied to NativeScript/React Native or native Java/Kotlin/Swift - these don't need a web wrapper to run.
特别是,如果您将 Cordova/PhoneGap 应用程序与任何 HTML5/JavaScript 框架/游戏(Ionic/Phaser)结合使用,这些应用程序希望通过使用 WebView 作为 Web 包装器在 iOS 上运行(我与此问题相关的个人经验)。但是,不确定同样的问题是否适用于 NativeScript/React Native 或本机 Java/Kotlin/Swift - 这些不需要 Web 包装器来运行。
Nevermind, please update your iPhone/iPad to iOS 13.4and (!!)Xcode to 11.4. Both of them have been released 3 days ago and can confirm that my Cordova-wrapped app doesn't has the log anymore and doesn't crash.
没关系,请将您的 iPhone/iPad 更新到 iOS 13.4并将 (!!)Xcode 更新到 11.4。它们都在 3 天前发布,可以确认我的 Cordova 包装的应用程序不再有日志并且不会崩溃。
For historical reasons I'll write a note - the affected iOS versions were: 13.2.X, 13.3.X including its betas. If you're reading this after some time - you need to get rid off those by upgrading to a higher version than 13.3 (recommended) or downgrading to lower version than 13.2 (not recommended). The second option you can use only if Apple for some reason would block you with further updates, e.g. your iPad/iPhone will be really old.
由于历史原因,我会写一篇笔记 - 受影响的 iOS 版本是:13.2.X、13.3.X 包括它的测试版。如果您在一段时间后阅读本文 - 您需要通过升级到高于 13.3 的版本(推荐)或降级到低于 13.2 的版本(不推荐)来摆脱这些。只有当 Apple 出于某种原因阻止您提供进一步更新时,您才可以使用第二个选项,例如您的 iPad/iPhone 真的很旧。
回答by Steve Heffern
I will pre-admit this is a terrible "answer" but it is a valid observation. This has something to do with sandboxing. If you rebuild your app without a sandbox, there are no messages. If you turn on the sandbox and enable Outgoing Connections which is all I need for my app, every mouse event in the webkit gives me the unhappy message.
我会预先承认这是一个糟糕的“答案”,但这是一个有效的观察。这与沙箱有关。如果您在没有沙箱的情况下重建您的应用程序,则不会有任何消息。如果您打开沙箱并启用我的应用程序所需的传出连接,则 webkit 中的每个鼠标事件都会给我一个不愉快的消息。
If I also include Incoming Connections, just as a test, same messages.
如果我还包括传入连接,作为测试,同样的消息。
Remove the sandbox (for an internal use only app), no stupid messages. Perhaps this observation will help someone at Apple track this problem down some more.
删除沙箱(仅供内部使用的应用程序),没有愚蠢的消息。也许这一观察将帮助 Apple 的某个人进一步追踪这个问题。
回答by George_E
I don't really know why this affects it, but hey ˉ\_(ツ)_/ˉ
我真的不知道为什么这会影响它,但是嘿ˉ\_(ツ)_/ˉ
I am using Firebase
- and here was a line in my Podfile:
我正在使用Firebase
- 这是我的 Podfile 中的一行:
pod 'Firebase/DynamicLinks'
After removing that, I no longer got these logs. Strange, but it works I guess if you don't yet need this pod for now.
删除后,我不再收到这些日志。奇怪,但如果你现在还不需要这个 pod,我想它可以工作。
This may also be an issue for other pods, who knows.
这也可能是其他 pod 的问题,谁知道呢。
I have that line in my Podfile for a feature I am yet to implement, but can't until I get a full Apple Developer Membership account.
我的 Podfile 中有该行用于我尚未实现的功能,但直到我获得完整的 Apple Developer Membership 帐户才能实现。
回答by Addict
Note that you have to use both iOS 13.4
on your device, and Xcode 11.4
, otherwise, you'll still see the logs.
请注意,您必须iOS 13.4
在设备上同时使用两者Xcode 11.4
,否则,您仍会看到日志。