No valid file provider found with identifier

I was able to add new domain with 'NSFileProviderManager.add' function in Xcode past 2 months. Yesterday I created .pkg file (installer file) for distribution with 'pkgbuild' and 'productbuild' commands in terminal.

I successfully install application and test it then uninstall it. However after this, In Xcode I cannot add new domain anymore. I keep getting "Error Domain=NSFileProviderErrorDomain Code=-2001 "No valid file provider found with identifier ‘’."

Command that used to create .pkg file

  1. pkgbuild --root "path" --scripts "path" --identifier "same bundle identifier with app" --version 1.0 --install-location /Applications "newpkg.pkg"
  2. productbuild --synthesize --package "newpkg.pkg" Distribution.xml
  3. productbuild --distribution Distribution.xml --package-path "newpath.pkg" "newpathrelease.pkg"

NOTE: When app is installed (But not running). I am able to add new domain in Xcode. After I uninstall app, I start to get same error again

NOTE: I uninstall app by move it to Trash from Applications directory in finder

Any suggestion about add new domain in Xcode during development? Or How to fix 'No valid file provider found with identifier' error

This error indicates that the system could not find the file provider extension.

Your project worked before the un-installation, and so I'd believe that your Xcode project is configured correctly.

I am wondering if the existence of the un-installed app (and extensions) has the system fail to find the extension when you run the app from Xcode. For debugging purpose, did you try to empty the trash and restart the machine?

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Unfortunately, Uninstalling app, emptying trash then restarting did not solve the error. I still keep getting same error

NOTE: When I change bundle identifier in Xcode to something else, I was able to add new domain but after I changed it back to previous identifier, I start to get same error

Any suggestion about this?

I am wondering if the system caches the information of the (removed) extension...

For debugging purpose (again), would you mind to try to bump the value of the CFBundleVersion entry in the Info.plist file (of both app and extension) and see if that changes anything? Bumping the value tells the system to re-scan the app bundle and update the cached info. I am curious if that helps...

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

No valid file provider found with identifier
 
 
Q