17

I'm suddenly getting this error on Yosemite:

***storageTaskManagerExistsWithIdentifier:withIdentifier failed: 
Error Domain=NSCocoaErrorDomain 
Code=4099 "Couldn’t communicate with a helper application." 
(The connection to service named com.apple.nsurlstorage-cache was invalidated.) 

UserInfo=0x6000000621c0 
{NSDebugDescription=The connection to service named com.apple.nsurlstorage-cache was invalidated.}; 

The app was working perfectly on Mavericks. Any ideas what might be going on?

(I don't even have a clue where too look at... Sure, I have a WebView in there, but I haven't yet manage to figure out where the error is triggered...)

Dr.Kameleon
  • 22,532
  • 20
  • 115
  • 223

7 Answers7

38

This issue is very likely due to sandboxing as @ingrid already pointed out. But if you want to distribute our app(s) via the Mac App Store you can not just switch sandboxing off (which isn't recommended anyway). Instead enable the 'Outgoing Connections' capability.

  • Click on your project file
  • Choose the App's build target
  • On the 'Capabilities' tab extend 'App Sandbox'
  • Enabled the 'Outgoing Connections (Client)' checkbox

enter image description here

martn_st
  • 2,576
  • 1
  • 24
  • 30
2

I'm getting this problem also. Are you using NSAttributed string initWithHTML: method?

There is also a known problem with the open and save panels which rely on helper applications. (This would have been a comment but I can't leave comments yet!)

Rob Sanders
  • 5,197
  • 3
  • 31
  • 58
  • Well, I'm pretty sure I made the error disappear.And no, I wasn't using an `NSAttributedString`. What I was doing was to `loadRequest:` into the `mainFrame` of the window, but then I figure out the html to be loaded was blank. When I fixed that error with `NSURLRequest`, the error I mentioned went away... – Dr.Kameleon Nov 10 '14 at 05:22
1

I had this error too, in my case the file .entitlements the key App Sandbox was in "YES", I changed it to "NO".

ingrid
  • 47
  • 3
1

@martn_st post is the first step, but Accroding to Fabric OSX Support: https://docs.fabric.io/apple/crashlytics/os-x.html

Intercepting and reporting uncaught exceptions on OS X is more complex than it is on iOS. On OS X, AppKit will catch exceptions thrown on the main thread, preventing the application from crashing, but also preventing Crashlytics from reporting them. To make matters worse, Apple’s frameworks are not exception safe. This means that while AppKit will prevent your app from crashing, it will also likely corrupt your process’s state, often including AppKit itself. Typically, once an exception involving UI interaction is thrown, it will prevent your app from working correctly from that moment on.

You need to Put the following code in didFinishLaunchWithOption

Swift 3

UserDefaults.standard.register(defaults: ["NSApplicationCrashOnExceptions": true])

Swift pre-3

NSUserDefaults.standardUserDefaults().registerDefaults(["NSApplicationCrashOnExceptions": true])

Objective-C

[[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"NSApplicationCrashOnExceptions": @YES }];

Community
  • 1
  • 1
stan liu
  • 1,712
  • 1
  • 11
  • 14
0

if you are using service, you don't have ui for that, so you in the {name}.entitlements you should add this key: com.apple.security.network.server as Boolean type and YES for value and/or com.apple.security.network.client as Boolean type and YES for value

Slava Vedenin
  • 58,326
  • 13
  • 40
  • 59
Almog_0
  • 422
  • 4
  • 11
0

For those who got this problem with keyboard extension on iOS:

  1. Open Settings
  2. Keyboards
  3. [Select your keyboard here]
  4. Grant full access
slxl
  • 635
  • 1
  • 10
  • 23
0

Open terminal and execute following two commands, I am using xcode 8

xcrun git config --global user.email you@yourdomain.com

xcrun git config --global user.name "Your Name Here"
Frits
  • 7,341
  • 10
  • 42
  • 60
Hiren Panchal
  • 2,963
  • 1
  • 25
  • 21