Can't download a file in file provider because of a system error.

Now, I have created an extension via the fileprovider template and adopts fileprovider protocols. But when i download a file, the system throws the error:

"Couldn't communicate with helper application".

From the system log i can see that the fetch-content failed with such error:

┳139b4 ‼️ done executing <FP2 ‼️ fetch-content(a file 1) why:materialization|itemChangedRemotely sched:userInitiated.1647482996.810533#1647482996.810533 error:<NSError: Cocoa 4101 "Couldn't communicate with helper application." Underlying={NSError: POSIX 2 "couldn't issue sandbox extension com.apple.app-sandbox.read-write for '/f/db641e9a04e144c6b320': No such file or directory" }}>>

Any advise would be appreciated, thanks!

Replies

But when i download a file, the system throws the error

You’re talking about downloading a file within your file provider, right? If so, what API are you using for that download?

Oh, and what platform are you targeting?

Share and Enjoy

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

  • Hello, thanks for you replay. Yes, I'm talking about downloading a file within my file provider. The platform is macos and language is obj-c. I use a remote url as the parameter of fetchContentsForItemWithIdentifier's completionHandler. I can directly download the file through this url.

  • The URL passed to the fetchContents completion handler, must be a local file URL which is on the same volume as the user-visible file location. Your extension will need to download the file and place it's contents at a URL on that volume.

    You can obtain a temporary directory which is guaranteed to be on the same volume, by calling -[NSFileProviderManager temporaryDirectoryURLWithError:].

    Further documentation is available here: https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3656535-temporarydirectoryurl

Add a Comment