1

I'm trying to implement WKWebView on Cocoa/MacOS but I'm getting this error:

Unable to load Info.plist exceptions (eGPUOverrides)
Couldn't read values in CFPrefsPlistSource<0x600002909f10>
(Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: kCFPreferencesNoContainer, Contents Need Refresh: Yes): accessing preferences outside an application's container requires user-preference-read or file-read-data sandbox access

Here is my implementation:

import Cocoa
import WebKit

class ViewController: NSViewController {
    @IBOutlet var webView: WKWebView!

    override func viewDidLoad() {
        super.viewDidLoad()
        if let url = URL(string: "https://www.apple.com") {
            let request = URLRequest(url: url)
            webView.load(request)
        }
    }
}

My question is how can I fix this issue on my implementation?

pkamb
  • 33,281
  • 23
  • 160
  • 191
user2924482
  • 8,380
  • 23
  • 89
  • 173
  • The error is stating that your app is not entitled to access (com.apple.Accessibility); have you added the entitlement? – l'L'l Jan 03 '19 at 19:57
  • https://stackoverflow.com/questions/52707411/wkwebview-problems-in-macos-mojave – TheNextman Jan 03 '19 at 20:28
  • Possible duplicate of [Failed to read values in CFPrefsPlistSource iOS 10](https://stackoverflow.com/questions/38275395/failed-to-read-values-in-cfprefsplistsource-ios-10) – pkamb Mar 12 '20 at 04:36

0 Answers0