问题
I have a very simple App that just displays a Website in a WKWebView
but after upgrading to macOS Mojave i get some weird warnings messages.
The App compiles but doesn't start.
My Code:
@IBOutlet var webView: WKWebView!
override func loadView() {
webView = WKWebView()
webView.navigationDelegate = self
view = webView
}
override func viewDidLoad() {
super.viewDidLoad()
let url = URL(string: "https://www.apple.com")!
webView.load(URLRequest(url: url))
}
The warnings i get:
2018-10-08 19:27:24.466406+0200 MyApp[616:13277] [default] Unable to
load Info.plist exceptions (eGPUOverrides)
2018-10-08 19:27:24.689229+0200 MyApp[616:13232] [User Defaults]
Couldn't read values in CFPrefsPlistSource<0x600002910070> (Domain:
com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No,
Container: kCFPreferencesNoContainer, Contents Need Refresh: No):
accessing preferences outside an application's container requires user-
preference-read or file-read-data sandbox access
Since macOS Mojave isn't that old I didn't find anything useful on the internet. I hope someone can help me.
EDIT: The second warning can be stopped by turning off "App Sandbox" in Project -> Capabilities
回答1:
This error is caused by enabled Sandbox being enabled. Disabled that in Capabilities -> Sandbox.
accessing preferences outside an application's container requires user- preference-read or file-read-data sandbox access
来源:https://stackoverflow.com/questions/52707411/wkwebview-problems-in-macos-mojave