在苹果硅M1上,不可能选择UIImagePicker控制器来选择图像。在图片库中,当你点击图像时,界面什么也不做,没有反应--退出界面--你必须点击“取消”按钮,但不幸的是,它也不能工作。在相同代码和相同anything.To版本的真实设备设备或英特尔处理器mac模拟器中,它工作得很好。
目前我正在下面的配置上进行测试
System OS: macOS Bigsur(11.2.2)
chip: Apple M1
iOS Simulator: iPhone11(iOS 14.4)
xCode:12.0.4当我试图选择图像时,我会得到如下异常
<NSXPCConnection: 0x60000016a080> connection on anonymousListener or serviceListener from pid 17615: Warning: Exception caught during invocation of selector didSelectMediaWithInfoDictionary:, dropping incoming message and invalidating the connection.
Exception: *** -[NSURL URLByAppendingPathExtension:]: component, components, or pathExtension cannot be nil.
*** -[NSURL URLByAppendingPathExtension:]: component, components, or pathExtension cannot be nil.
(
0 CoreFoundation 0x00007fff20421af6 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007fff20177e78 objc_exception_throw + 48
2 Foundation 0x00007fff20860900 -[NSURL(NSURLPathUtilities) URLByDeletingPathExtension] + 0
3 PhotosUI 0x00007fff3faf656a -[PUPhotoPickerExtensionHostContext _UIImagePickerControllerInfoDictionaryFromPhotoPickerInfoDictionary:] + 2177
4 PhotosUI 0x00007fff3faf5b5b -[PUPhotoPickerExtensionHostContext didSelectMediaWithInfoDictionary:] + 34
5 Foundation 0x00007fff209290e3 __NSXPCCONNECTION_IS_CALLING_OUT_TO_EXPORTED_OBJECT_S1__ + 10
6 Foundation 0x00007fff20927e1b -[NSXPCConnection _decodeAndInvokeMessageWithEvent:flags:] + 2268
7 Foundation 0x00007fff20929412 message_handler + 206
8 libxpc.dylib 0x00007fff20055cac _xpc_connection_call_event_handler + 56
9 libxpc.dylib 0x00007fff2005603e _xpc_connection_mach_event + 905
10 libdispatch.dylib 0x000000010c73ba68 _dispatch_client_callout4 + 9
11 libdispatch.dylib 0x000000010c755ba8 _dispatch_mach_msg_invoke + 550
12 libdispatch.dylib 0x000000010c7420ad _dispatch_lane_serial_drain + 307
13 libdispatch.dylib 0x000000010c756a76 _dispatch_mach_invoke + 563
14 libdispatch.dylib 0x000000010c7420ad _dispatch_lane_serial_drain + 307
15 libdispatch.dylib 0x000000010c742f9d _dispatch_lane_invoke + 493
16 libdispatch.dylib 0x000000010c74ede2 _dispatch_workloop_worker_thread + 882
17 libsystem_pthread.dylib 0x00007fff61167499 _pthread_wqthread + 314
18 libsystem_pthread.dylib 0x00007fff61166467 start_wqthread + 15
)渴望解决这个问题,实在令人难以置信。请帮我解决这个问题。
发布于 2022-01-11 20:08:59
我刚刚解决了这个问题。我在M1 Macbook Air上。
我升级到了蒙特利,但没能解决问题。然后我安装了Xcode 13,它使用iPhone 13作为模拟的默认电话,并开始工作。我不确定是Xcode升级还是使用iPhone 13完成了这个任务。
https://stackoverflow.com/questions/66668318
复制相似问题