Cannot launch new FileProvider extension on macOS 10.15

I am trying to get the File Provider extension to work on macOS 10.15 Beta 7 (19A546d) with Xcode 11 Beta (11M392r) so far did not manage to get it to launch with a sample project. The documentation is very lacking and there must be something I missed.


I have a Mac app that does the following on launch:


let domain = NSFileProviderDomain(identifier: NSFileProviderDomainIdentifier(rawValue: "com.app.testfileprovider"), displayName: "TestFileProvider", pathRelativeToDocumentStorage: "")

NSFileProviderManager.add(domain) { error in
    if let error = error {
        NSLog("Could not add file provider for domain: \(error)")
        return
    }

    guard let newManager = NSFileProviderManager(for: domain) else {
        NSLog("Could not create file provider manager.")
        return
    }

    self.manager = newManager
    NSLog("File provider URL: \(newManager.documentStorageURL.path)")
}


I sometimes get this error, not sure why:

Could not add file provider for domain: Error Domain=NSFileProviderInternalErrorDomain Code=3 "The value “com.myappbundleid” is not valid for the parameter “callerBundleID”." UserInfo={NSLocalizedDescription=The value “com.myappbundleid” is not valid for the parameter “callerBundleID”.}


The error may be resolved by a "killall Finder" command in Terminal, then it runs successfully, and outputs:

File provider URL: /Users/[username]/Library/Group Containers/group.com.myappgroup/File Provider Storage


In Finder the “File Provider Storage” folder appears with a cloud badge, which seems to be OK. I guess.


I have my File provider extension class, which is basically the generated code when I added the File provider extension to my Mac app in Xcode:


class FileProviderExtension: NSFileProviderExtension {
    var fileManager = FileManager()
    override init() {
        NSLog("File provider initialized")
        super.init()
    }
    ...


Here the “File provider initialized” message is never logged and the extension is never initialized. I cannot get it to launch at all.


In the Console.app this is the only relevant message I could find:


default 09:14:35.447849+0200 *** com.apple.launchservices - 45683955: Checking whether application is managed at file:///Users/laszlo.agardi/Library/Developer/Xcode/DerivedData/FileProviderMacTest-eebpahoydvfxovantvhkplhgrcty/Build/Products/Debug/FileProviderMacTest.app/Contents/PlugIns/FileProviderExt.appex//com.myapp.fptest.FileProviderExt


What I did so far:

  • the app and extension are sandboxed, it is set in the entitlements files
  • the app and extension share the same app group, also set in entitlements
  • Tried to launch the extension:
    • Run the file provider from Xcode, Xcode was waiting for the extension to launch
    • I opened the File Provider Storage folder in Finder, it has the cloud badge. But no file action inside or just browsing launches the File provider extension


What am I missing? How do I get the File Provider extension to launch on macOS Catalina?

Replies

I got it to launch by going to system prefrences -> Extensions and ticking it in there. Then I got the init etc, but nothing actually happened!


NB. As of Beta 8 (Xcode 11 GM) it has been taken out!!!


PS. If you do add a domain and then change the domain name in your code you may crash the system prefrences -> Extensions tab. Simply add a removal all domains to your code to tidy up on exit and it will un-crash the prefrences :-)

Update:


In macOS Beta 8 and Xcode 11 GM, NSFileProviderExtension is no longer available to Mac apps. However the documentation says it is available for Mac Catalist apps.

When I try to build a Mac Catalyst app with file provider extension I get the error:


error: File Provider extensions are not available when building for Mac Catalyst. (in target 'TestFPExtension' from project 'TestFP2')

It's 2020 now, iCloud Shared Folders appeared on last weeks macOS 10.15.4 betas, but Xcode 11.4 beta still do not have FileProvider for macOS back. On the other hand, FileProvider documentation says it should be available on macOS 10.15 and Catalyst.
Any estimations? Should we expect it any time soon or it is delayed for longer than spring?

The NSFileProviderExtension API is not formally shipped for macOS yet. If your app has use cases relying on it, please file feedback for us to vote the priority. Please post your feedback ID here if you do it. Thanks.

I've done it FB7788379 :)

The NSFileProviderExtension API is not formally shipped for macOS yet. If your app has use cases relying on it, please file feedback for us to vote the priority. Please post your feedback ID here if you do it. Thanks.

Hi, DTS Engineer, how is the progress of NSFileProviderExtension API as of July 3, 2020?
Since macOS 10.15 is the last macOS that can load deprecated kernel extension, and macOS 11.0 Big Sur won't load kext with deprecated KPIs.
Yap, DTS Engineer... how is progress going on this issue? We are really in need of this API since we are developing our iOS software "OX Drive" that should be available via mac Catalyst on macOS, too. So, it would be very great if Apple is "shipping this API formally" asap. 😊

Cheers
Frank @OpenXchange

how is progress going on this issue?

I’m sad to say that no shipping or seeded version of macOS includes support for file provider extensions.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
It would seem that there's a new page added detailing FileProvider macOS Support

If you compare the main FileProvider documentation page to a Waybackmachine page back in June, you'll see that the link to "macOS Support" did not exist before and was recently added.

If you click into a protocol there, you'll see that availability is set for 11.0+

Perhaps this means that the API will be available for use on Big Sur? Perhaps someone can try out beta 3 and see?

Perhaps someone from Apple can give us an indication on whether it'll be removed again before GM like last time?
The file provider extension support is actually included in the current macOS Big Sur Beta, and the new APIs for macOS support are listed here:
https://developer.apple.com/documentation/fileprovider/macos_support
Does that mean that it WON'T be available for macOS 10.15+ or will it eventually? By the way, if this is not available, is VFS kext the only way around for Catalina?

Does that mean that it WON'T be available for macOS 10.15+ … ?

Right now it’s only supported on 11.0 beta.

or will it eventually

I can’t predict the future, alas, but my experience is that Apple rarely backports large features like this to older OS releases.

By the way, if this is not available, is VFS kext the only way around for Catalina?

That’s one option. Depending on your specific requirements you may also be able to use a Finder Sync extension.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Thanks! I understand you can't predict the future XD, but I thought there would be a roadmap of features to be included in future Catalina releases. And since File Provider was included as a Catalina feature and then removed from documentation, it seemed to be something that would eventually be included.

About my specific requirements, I need to be able to create placeholder for cloud files that are not downloaded, i.e. I don't think Finder Sync ext can help with that, can it?

Thanks again
RS

The file provider extension support is actually included in the current macOS Big Sur Beta, and the new APIs for macOS support are listed here: https://developer.apple.com/documentation/fileprovider/macos_support

Hi, DTS engineer, does this meaning that FileProvider API now available and runnable in macOS 11.0 Beta?

does this meaning that FileProvider API now available and runnable in macOS 11.0 Beta?

That’s the theory. Although my experience is that the difference between theory and practice is a lot bigger in practice then it is in theory.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"