Reputation: 38
So firstly, when I present the image picker I get this error:
2023-08-03 16:47:45.979280-0700 MyAppName[7794:1889375] [AXRuntimeCommon] Unknown client: MyAppName
Then when I choose an image I get this error:
2023-08-03 16:47:51.357123-0700 DownStream[7794:1889385] [AXRuntimeCommon] AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:7795 (
0 AXRuntime 0x00000001c1bb8acc _AXGetPortFromCache + 968
1 AXRuntime 0x00000001c1bbb038 AXUIElementPerformFencedActionWithValue + 852
2 UIKit 0x0000000220f7ae5c D402ECD6-842A-3487-9D23-92A0EA9DFBEA + 790108
3 libdispatch.dylib 0x00000001069f4520 _dispatch_call_block_and_release + 32
4 libdispatch.dylib 0x00000001069f6038 _dispatch_client_callout + 20
5 libdispatch.dylib 0x00000001069fe0b0 _dispatch_lane_serial_drain + 984
6 libdispatch.dylib 0x00000001069fedf4 _dispatch_lane_invoke + 412
7 libdispatch.dylib 0x0000000106a0bc74 _dispatch_workloop_worker_thread + 736
8 libsystem_pthread.dylib 0x00000001f68f5ddc _pthread_wqthread + 288
9 libsystem_pthread.dylib 0x00000001f68f5b7c start_wqthread + 8
)
Here is my code for the picker:
internal func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
var selectedImageFromPicker: UIImage?
if let editedImage = info[UIImagePickerController.InfoKey.editedImage] as? UIImage{
selectedImageFromPicker = editedImage
} else if let originalImage = info[UIImagePickerController.InfoKey.originalImage] as? UIImage {
selectedImageFromPicker = originalImage
}
if let imageUrl = info[UIImagePickerController.InfoKey.imageURL] as? URL{
let imgName = imageUrl.lastPathComponent
let documentDirectory = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first
let localPath = documentDirectory?.appending(imgName)
let data = selectedImageFromPicker!.pngData()! as NSData
data.write(toFile: localPath!, atomically: true)
_ = URL.init(fileURLWithPath: localPath!)
try! selectedImageFromPicker?.jpegData(compressionQuality: 0.1)?.write(to: imageUrl)
uploadFile(image: selectedImageFromPicker!)
picker.dismiss(animated: true, completion: nil)
}
}
What can I do? Are there any word arounds?
Upvotes: 0
Views: 84