5

I am trying to run a cocoapod dependency ios-PDF-Reader and when I select a pdf on my phone via 'Files' app I get the following error:

[DocumentManager] Failed to associate thumbnails for picked URL file:///private/var/mobile/Containers/Data/Application/../../Welcome.pdf 
with the Inbox copy file:///private/var/mobile/Containers/Data/Application/../../tmp/com../Welcome.pdf: 
Error Domain=QLThumbnailErrorDomain Code=102 "(null)" 
UserInfo={NSUnderlyingError=0x28226cf90 {Error Domain=GSLibraryErrorDomain Code=3 "Generation not found" 
UserInfo={NSDescription=Generation not found}}}

Has anyone gotten the failed to associate thumbnail error before? and is there a simple fix for it? Here is the code where it breaks:

extension TestPdfEpubViewController: UIDocumentPickerDelegate {
    func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
guard let selectedFileURL = urls.first else { return }
            //create pdf first
            let documentFileURL = Bundle.main.url(forResource: selectedFileURL.absoluteString, withExtension: "pdf")!
            let document = PDFDocument(url: documentFileURL)!
            //then display the pdf
            let readerController = PDFViewController.createNew(with: document)
            navigationController?.pushViewController(readerController, animated: true)
        }
}

Andrew
  • 26,706
  • 9
  • 85
  • 101
dpat0074
  • 175
  • 13
  • any luck you made dealing with this showstopper? – Talha Hafeez Jan 09 '20 at 12:01
  • Does this answer your question? [iCloud Drive Issue: "\[DocumentManager\] Failed to associate thumbnails for picked URL"](https://stackoverflow.com/questions/51793060/icloud-drive-issue-documentmanager-failed-to-associate-thumbnails-for-picked) – Developer Extraordinare Jul 08 '21 at 14:35

0 Answers0