Reputation: 121
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
Upvotes: 4
Views: 1788
Reputation: 11
I also had this issue when trying to package a FileProvider Extension into my MacOS electron application.
The key to the solution for me was as stated in @HarshitGindra's comment: I needed to add the correct provisioning profile. Turns out the automatically generated provisioning profile from XCode was using my personal developer ID as opposed to my organization ID and so notarization failed.
I determined it was a notarization issue by running the following command:
spctl -vvv --assess --type exec <path-to-app>
I recieved the error:
source=Unnotarized Developer ID
Here are all the steps I took to resolve this issue:
Hope this helps!
Upvotes: 1
Reputation: 11
I've succeeded to load the FileProvider plugin under /Applications folder:
Hope this helps.
Upvotes: 1