"Unable to find file provider extension with identifier" error

I’m developing a file provider extension for macOS; I’m working with xcode 16 and macOS Sequoia.

I created an host application via xcode with a simple button “Add domain” that triggers the following code:

let domain = NSFileProviderDomain(identifier: NSFileProviderDomainIdentifier(rawValue: "me.piranef.fileprovider"), displayName: "piranef") NSFileProviderManager.add(domain) { theError in NSLog(">>> ERROR: \(theError?.localizedDescription ?? "No error")") } Note: I provide the link to the whole project on GitHub below.

Finally I added via xcode a file provider target:

At this point everything should be ok to run a simple stub application that once running add a piranef file provider visible under any file manager window in finder.

But the following error appears:

No file provider was found with the identifier “me.piranef.MyFileProviderTester”

My suspect is that despite the target has been created by xcode, some setup in some .plist or .entitlement file must be changed manually or some tricky key added to make the file provider extension visible to the hosting application.

I tried to manually change some setup that appeared logical for me like:

  • The product bundle identifier in the target -> build settings of the extension:

  • App Groups in the .entitlements file of the extension that seems set to a placeholder file, set to the same value of the host application:

  • An hint I got reading the readme file of the FruitBasket sample application (by Apple) is to embed without signing the extension into the main app: Done! It’s ok!

To give all possible information I uploaded the whole project into my github profile at: https://github.com/fpiraneo/fileproviderstub/

Any hint is welcome; I already googled or searched in StackOverflow or even asked ChatGPT for help but with no results.

Even other users are experiencing the same issue and posting on StackOverflow with no answers:

"Error adding File Provider domain: No valid file provider found with identifier ‘MyApp.FinderExtensionHost’ on MacOS” on StackOverflow

Answered by Frameworks Engineer in 808596022

Looking at your repository, you specify a group group.me.piranef.MyFileProviderTester in your Info.plist. In your entitlements, you declare access to a group me.piranef.MyFileProviderTester. These are different identifiers.

You do not have to specify a group in your Info.plist, but if you do specify one the system will check that your extension has access to it and exclude it as invalid if it doesn't. It will log somewhat loudly in that case, so if you look at the logs for the com.apple.FileProvider subsystem you should see the corresponding error. Note also that you can install the logging profile to un-redact the logs, although this particular statement is mostly unredacted either way.

Looking at your repository, you specify a group group.me.piranef.MyFileProviderTester in your Info.plist. In your entitlements, you declare access to a group me.piranef.MyFileProviderTester. These are different identifiers.

You do not have to specify a group in your Info.plist, but if you do specify one the system will check that your extension has access to it and exclude it as invalid if it doesn't. It will log somewhat loudly in that case, so if you look at the logs for the com.apple.FileProvider subsystem you should see the corresponding error. Note also that you can install the logging profile to un-redact the logs, although this particular statement is mostly unredacted either way.

Hi, the NSExtensionFileProviderDocumentGroup on Info.plist has been inserted automatically by xcode; once removed it worked; however now I have the problem that I cannot use any debug tool for the extension! Breakpoint doesn’t work and also logging with:

let defaultLog = Logger()
defaultLog.log("Test message for logging!")

Logs only on the main app but don’t produce anything starting from the extension! Is this regular? How can I proceed to debug into the extension with breakpoints and other usual tools?

I managed in somewhat way to debug both the container application and the extension; once added the domain I can see on my logs the creation of a new enumerator class (FileProviderEnumerator); following your documentation I expect that the function func enumerateItems(for observer, startingAt page) is automatically called by the system to get the content of the directory; however this doesn’t happens! Do I have to call this function manually on my init() once the enumerator has been created?

Do you have a more handy example than the FruitBasket?

"Unable to find file provider extension with identifier" error
 
 
Q