Loading file representation in performDropWithCoordinator crashes when dragging files from iCloud Drive
| Originator: | anders | ||
| Number: | rdar://32736408 | Date Originated: | June 13 2017 |
| Status: | Open | Resolved: | |
| Product: | iOS+SDK | Product Version: | iOS 11 (15A5278f) |
| Classification: | Other bug | Reproducible: | Always |
Using Drag and Drop to drag a file from the iCloud Drive section of the Files app into another app causes a crash in a system call.
Specifically I have a app where you can drag items into a UITableView and tableView:performDropWithCoordinator: that calls
[item.dragItem.itemProvider loadFileRepresentationForTypeIdentifier: (id)kUTTypeData completionHandler:].
This causes a crash after calling loadFileRepresentationForTypeIdentifier:completionHandler: but before the completion handler is called. The crash does not happen when dragging files from "On My iPad".
Steps to Reproduce:
1. Launch app that listens to drops using the new iOS 11 Drag and Drop API's.
2. Open the Files app
3. Navigate to iCloud Drive
4. Drag files into the listening app
5. Drop the file
Expected Results:
Calling [item.dragItem.itemProvider loadFileRepresentationForTypeIdentifier: (id)kUTTypeData completionHandler:] should produce a file url on the completion handler.
Observed Results:
App crashes after log statements such as:
2017-06-13 12:59:18.435775+0200 Working Copy[824:46460] open on /var/mobile/Containers/Data/Application/E6174B29-DE1E-49D5-BFFD-DD17E23F3CF7/Documents/README.md: File exists
2017-06-13 12:59:18.437644+0200 Working Copy[824:46460] Documents directory:
/var/mobile/Containers/Data/Application/E6174B29-DE1E-49D5-BFFD-DD17E23F3CF7/Documents
2017-06-13 13:00:16.550079+0200 Working Copy[824:46496] [default] [ERROR] Could not resolve bookmark. Error: Error Domain=NSFileProviderInternalErrorDomain Code=1 "The reader is not permitted to access the URL." UserInfo={NSLocalizedDescription=The reader is not permitted to access the URL.}
2017-06-13 13:00:16.550217+0200 Working Copy[824:46496] Could not resolve file provider-backed URL. Error: Error Domain=NSFileProviderInternalErrorDomain Code=1 "The reader is not permitted to access the URL." UserInfo={NSLocalizedDescription=The reader is not permitted to access the URL.}
Version:
iOS 11 (15A5278f)
Notes:
I attached a screendump of the crash to make it clear it happens in system-code.
Configuration:
It happens on a iPad Pro 12" (the original one).
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!