I'm using UIDocumentBrowserViewController and encountering the following error when trying to create a new file with Dropbox:
Couldn’t communicate with a helper application.
The error does not occur with iCloud or "On My iPad" (local storage).
What does this error mean?
More specifically, I have the following code to call the importHandler
:
func documentBrowser(_ controller: UIDocumentBrowserViewController, didRequestDocumentCreationWithHandler importHandler: @escaping (URL?, UIDocumentBrowserViewController.ImportMode) -> Void) {
let templateURL = Bundle.main.resourceURL!.appendingPathComponent("Templates").appendingPathComponent("Sphere-128.sculptura")
importHandler(templateURL, .copy)
}
After calling importHandler
I get a call to func documentBrowser(controller: UIDocumentBrowserViewController, failedToImportDocumentAt documentURL: URL, error: Error?)
with the error above.
Apple's Particles app seems to work fine, so this is particular to my configuration.
Will file a DTS and update this question.
Update
I noticed the following error in the device console:
importDocument: Unable to import the file to the FileProvider. Error: Error Domain=NSCocoaErrorDomain Code=4101 UserInfo={NSFileProviderErrorItemName=<private>, NSUserStringVariant=Move, NSFilePath=<private>, NSUnderlyingError=0x282d11dd0 {Error Domain=DBFileProviderErrorDomain Code=1}}
This appears to be a bug in the Dropbox file provider. Creating a document in GarageBand yields the same error. I suspect this is because like my app, GarageBand uses packages (directories) instead of files for documents. Other apps which use files (the Particles demo, Pages, etc) work fine.