请查看你ios 文件夹下的这个文件ios/Runner/Info.plist
补上以下代码(权限相关)
<key>NSPhotoLibraryUsageDescription</key>
<string>Allow access to photo library</string>
<key>NSCameraUsageDescription</key>
<string>Allow access to camera to capture photos</string>
<key>NSMicrophoneUsageDescription</key>
<string>Allow access to microphone</string>
问题描述:
点击选择图片之后,出现如下异常
Lost connection to device.
Exception: Unable to terminate com.example.appFlutter on 1A1ACF03-EDCB-4FE9-9BE2-C174FDCC2169:
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
Simulator device returned an error for the requested operation.
found nothing to terminate
Underlying error (domain=NSPOSIXErrorDomain, code=3):
The request to terminate "com.example.appFlutter" failed. found nothing to terminate
found nothing to terminate
Command: /usr/bin/arch -arm64e xcrun simctl terminate 1A1ACF03-EDCB-4FE9-9BE2-C174FDCC2169 com.example.appFlutter
the Dart compiler exited unexpectedly.