Xcode 9.2 UIDocumentBrowserViewController: Failed to create bookmark bookmarkString URL

Update: Xcode 9.3 beta fixed it.


When creating a UIDocument file in a UIDocumentBrowserViewController

enter image description here

[default] [ERROR] Failed to resolve bookmark. Error: Domain Error = NSFileProviderInternalErrorDomain Code = 1 "The reader is not allowed to access the URL." UserInfo = {NSLocalizedDescription = The reader is not allowed to access the URL.}

[DocumentManager] Failed to create bookmark bookmarkString URL (Error Domain = NSFileProviderInternalErrorDomain Code = 1 "Reader is not allowed to access the URL." UserInfo = {NSLocalizedDescription = The reader is not allowed to access the URL.})

The code works well in Xcode 9.1, but does not work in Xcode 9.2. almost the same code as wwdc 2017.

 func documentBrowser(_ controller: UIDocumentBrowserViewController, didRequestDocumentCreationWithHandler importHandler: @escaping (URL?, UIDocumentBrowserViewController.ImportMode) -> Void) { let newDocumentURL: URL? = R.file.templateDocument() // Set the URL for the new document here. Optionally, you can present a template chooser before calling the importHandler. // Make sure the importHandler is always called, even if the user cancels the creation request. if newDocumentURL != nil { importHandler(newDocumentURL, .copy) } else { importHandler(nil, .none) } } 

enter image description here

+7
ios xcode core-data uidocument
source share

No one has answered this question yet.

See similar questions:

7
Create UIDocument in iOS 11: Reader Not Allowed to Access URL

or similar:

1348
How to "add existing frames" in Xcode 4?
981
How to download Xcode DMG or XIP file?
868
Xcode Error "Could not find disk image for developers"
818
Git ignore file for Xcode projects
746
Failed to start Xcode process: security
455
The resource cannot be loaded because the application security policy for transport requires the use of a secure connection
5
Disable application transport security in Xcode 9.2?
one
Running a project created in Xcode 8 on Xcode 9
one
Xcode 9.2 does not start: plugin loading failed
0
Problem with iCloud Drive: "[DocumentManager] Failed to link thumbnails for selected URL"

All Articles