[Flutter] ios에서 image_picker 사용시 에러 현상 (해결)

여름·2023년 6월 15일
0

flutter

목록 보기
1/5

⚡️ flutter로 ios 시뮬레이터 사용시 일어나는 에러

프로젝트를 하던중 image_picker를 설치하고 빌드를 하자 다음과 같은 오류가 발생했다.

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 operation couldn’t be completed. found nothing to terminate
	found nothing to terminate

ios는 사진 권한이 필요하다는 에러였다.
해결 방법은 <project root>/ios/Runner/Info.plist 파일에 <key>값을 추가해주면 된다.

<key>NSCameraUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>
<key>NSMicrophoneUsageDescription</key>
<string>Used to capture audio for image picker plugin</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>

윗 코드를 추가하여 카메라, 마이크, 사진 권한을 줄 수 있다.

📁 참고

image_picker

잘못된 정보가 있을 수 있습니다. 댓글을 통해 피드백 부탁드립니다!

profile
https://limsummer.tistory.com/ 에서 이사 왔습니다.

0개의 댓글