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