Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fileprovider does not get loaded when application is run from /Applications folder

I have developed a functional Application that uses the new NSFileProviderReplicatedExtension. Everything worked as expected until I started deployment and realized, that my application cannot add domain successfully while being run from /Applications folder. Calling:

[NSFileProviderManager addDomain:fileProviderDomain completionHandler:^(NSError * _Nullable error){}];

This call results in error:

Error Domain=NSFileProviderErrorDomain Code=-2001 "The application cannot be used right now." UserInfo={NSLocalizedDescription=The application cannot be used right now.}

Running the application from XCode build dir or ˜/Desktop fileprovider extension works as expected.

Upon closer inspection in console around a moment of calling "addDomain", I can see a line that does not come up when running the application from a different location.

kernel Sandbox: fileproviderd(448) deny(1) file-read-data /Applications/TestFileProvider.app

I have tried changing about everything in codesign and sandbox in build settings but no change. I have also tried making app in Obj-C and swift too - makes no difference. Any suggestions?


For reference here is my question on apple developer forums: https://developer.apple.com/forums/thread/696254

like image 269
Marcel Vyberal Avatar asked Oct 14 '25 16:10

Marcel Vyberal


1 Answers

I've succeeded to load the FileProvider plugin under /Applications folder:

  1. The application should be installed to /Applications folder as root user.
  2. The entitlements file (of main app) should contain the "com.apple.application-identifier" item.

Hope this helps.

like image 106
Tid Avatar answered Oct 18 '25 03:10

Tid