How do you handle NSFileProviderError with code "olderExtensionVersionRunning"

I'm building a file provider extension and running into an issue I don't understand and am not sure how to resolve.

I have been building the extension for a while and testing various things, and one of the biggest problems has been reliability. The current problem I'm running into is that when I build a new version of the process that contains the extension in Xcode, I get the error mentioned in the title when I try to register a domain (and the extension does not run).

There's not much information I can find about what this error means or how to deal with it. I cannot find any running processes associated with my host application or the extension's name or id (though I may not have looked in the right places). Restarting the computer doesn't seem to resolve the issue either. Any ideas?

(As an aside, at various points things have seemed to work just fine for me and even in a VM and then failed to work on other people's machines with no easily discernible reason, so any suggestions about ways to debug file provider issues are welcome)

Replies

I had what I believe is the same issue and it took me forever to figure out. I believe the full error I got in the console was Error Domain=NSFileProviderErrorDomain Code=-2003 "An older version of the application is currently in use which maps to olderExtensionVersionRunning. https://developer.apple.com/documentation/fileprovider/nsfileprovidererror/code/olderextensionversionrunning

It occurs when you run the extension from different file system locations. It is caused by the older version of your extension never being removed from the plugin registry.

I have found what fixes it is described in this stackoverflow post: https://stackoverflow.com/questions/44211893/extensions-pluginkit-and-craziness-on-macos

In summary: Use pluginkit -v -m -D -i my.bundle.id to get the location of your old extension. Use pluginkit -r path-to-my-extension to remove it.

Extra tip: you can use pluginkit -vvvvm to list all your registered plugins.

Hope that helps :)

  • NOTE: Through continued use I've discovered that sometimes a FileProvider extension instance will remain running even after it has been unregistered from pluginkit. Thereforepluginkit -v -m -D -i my.bundle.id does not reveal its path. However One can still use pluginkit -r path-to-extension command to close the extension instance as long as they know the path.

Add a Comment

Thanks, that's helpful. I'm wondering if there's something I can do in code though, and I'm imagining the situation where my app has been auto-updated and restarts itself. How can I ensure in that scenario that the old file provider extension is replaced with whatever newer extension is delivered in my app update? I haven't yet gotten far enough to see what happens in this specific scenario but I'm currently working towards that.