Picker Error Message on Exit (encountered while discovering extensions: Error Domain=PlugInKit Code=13) With Swift 4 - Xcode 9

前端 未结 10 1130
生来不讨喜
生来不讨喜 2021-01-31 10:04

Similar to

PhotoPicker discovery error: Error Domain=PlugInKit Code=13

and also to

https://forums.developer.apple.com/thread/82105

BUT I have t

相关标签:
10条回答
  • 2021-01-31 10:53

    Had this same issue on Swift 4.2 and Xcode 10.0. Although the image picker was working correctly Xcode showed this error on console. To get rid of this:

    • On Xcode menu Product > Scheme > Edit Scheme
    • Select 'Run' tab, then 'Arguments'
    • On 'Environment Variables' section add a variable with Name OS_ACTIVITY_MODE and Value disable
    0 讨论(0)
  • 2021-01-31 10:56

    For Swift 4:

    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
        guard let pickedImage = info[UIImagePickerController.InfoKey.originalImage] as? UIImage else {
            return
        }
        ...
    }
    
    • On method parameter, change from [String: Any] to [UIImagePickerController.InfoKey : Any]
    • On the picked image, change from info["UIImagePickerControllerOriginalImage"] to info[UIImagePickerController.InfoKey.originalImage]
    0 讨论(0)
  • 2021-01-31 10:58
    1. add the 'Privacy... ' to plist
    2. From Xcode menu open: Product > Scheme > Edit Scheme > On your Environment Variables set OS_ACTIVITY_MODE in the value set disable

    see in mc-system-group-container-and-mc-reading-from-public-effective-user-settings-err

    Work's fine for me

    EDIT

    if it's can help below my code (working with xcode 9)

    if libraryAuthorization == .authorized {
            let imagePicker = UIImagePickerController()
            imagePicker.delegate = self
            imagePicker.sourceType = UIImagePickerControllerSourceType.photoLibrary
            imagePicker.allowsEditing = false
            imagePicker.view.tag = button.tag
            self.present(imagePicker, animated: true, completion: nil)
        }
    }
    
    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
        if let pickerImage = info[UIImagePickerControllerOriginalImage] as? UIImage {
            photoContainer.addImageToButton(pickerImage, buttonTag: picker.view.tag)
            dismiss(animated: true)
        }
    }
    
    0 讨论(0)
  • 2021-01-31 11:00

    I also had this issue. It's very annoying because the console error comes up but the app is still loading the image. I requested authorization status, added my keys to the .plst, but found none of this to get the job done.

    Once I went to Product -> Scheme -> Edit Scheme -> Run then added key: "OS_ACTIVITY_MODE" value: "disable", cleaned and rebuilt...the error went away.

    0 讨论(0)
提交回复
热议问题