Issue with PHPicker

I am attempting to use PHPicker to allow the user to select a photo for use in my app. I see a behavior that if the user tries to search for a photo, the picker fails with error: "Picker Unavailable - There was an error while preparing the picker. Please try again later.". This behavior sometimes doesn't show until the second attempt. If the user doesn't interact with the search feature, then everything works fine.

I have made a simplified app that exemplifies the issue.
Github repo

Any help is appreciated.




Replies

Same "Picker Unavailable" error when using flutter library file_picker for images.
The bug is systematic on my iOS Simulator, but does not happen for anybody else I know.
Does anybody know what triggers in general this "Picker Unavailable" window? Could be some parameters inside Xcode, what do you think?
I have noticed if I use the PHPicker in the same way but launch it from a UIViewController with the controller as the delegate there is no issue.
  • I'm facing the same issue. Could you explain what you mean by launching from UIViewCOntroller ?

Add a Comment
Hi Ice, Fabrice,

did you find a solution. I tried to add it as delegate to the UIViewController but it's also not working:

class UIViewController: UIViewController, PHPickerViewControllerDelegate {
...
}

If you have a reference implementation can you share it on GitHub?

I found the exact same behavior here but they also did not have any solution so far

https://stackoverflow.com/questions/64121797/picker-unavailable-there-was-an-error-while-preparing-the-picker-please-try-ag

Code Block txt
2020-10-20 19:56:08.386568+0200 Capri[2928:151689] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
2020-10-20 19:56:09.034177+0200 Capri[2928:147896] [Picker] Picker failed with error: Error Domain=PXErrorDomain Code=-1 "PHPickerViewController did receive interruption." UserInfo={NSDebugDescription=PHPickerViewController did receive interruption.}
2020-10-20 19:56:09.035269+0200 Capri[2928:152165] [lifecycle] [u 05AECDAD-C4FF-4457-97C4-22EB9E4F5D5E:m (null)] [com.apple.mobileslideshow.photospicker(1.0)] Connection to plugin interrupted while in use.
2020-10-20 19:56:09.036025+0200 Capri[2928:152165] [lifecycle] [u 05AECDAD-C4FF-4457-97C4-22EB9E4F5D5E:m (null)] [com.apple.mobileslideshow.photospicker(1.0)] Connection to plugin invalidated while in use.
2020-10-20 19:56:09.036502+0200 Capri[2928:147896] [Picker] Picker failed with error: Error Domain=NSExtensionErrorDomain Code=-2 "Extension cancelled by host." UserInfo={NSLocalizedDescription=Extension cancelled by host.}
2020-10-20 19:56:09.037921+0200 Capri[2928:147896] [Picker] Picker failed with error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 2936 named com.apple.mobileslideshow.photospicker.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid." UserInfo={NSDebugDescription=The connection to service on pid 2936 named com.apple.mobileslideshow.photospicker.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.}


Tag: wwdc20-10652


Same issue here, iOS 14.5 Beta 7, SwiftUI app.