0
0

More than 3 years have passed since last update.

iOS Add the following keys to your Info.plist file, located in <project root>/ios/Runner/Info.plist:のエラー修正

Last updated at Posted at 2020-06-25

エラー内容

iOS Add the following keys to your Info.plist file, located in /ios/Runner/Info.plist: NSPhotoLibraryUsageDescription - describe why your app needs permission for the photo library. This is called Privacy - Photo Library Usage Description in the visual editor. NSCameraUsageDescription - describe why your app needs access to the camera. This is called Privacy - Camera Usage Description in the visual editor.

Flutterアプリケーション内でカメラへのアクセスと写真ライブラリーを試みた時に生じたエラー。アクセスを試みると同時にアプリが落ちてしまう。

Info.plistファイルに許可を与えることが必要らしい。

変更

スクリーンショット 2020-06-25 10.53.55.png
xcodeを開き、Info.plistファイルへ。

画像を見て一番上の二つのpropertyを加える。

  1. key: Privacy - Camera Usage DescriptionPrivacy - Photo Library Usage Descriptionを加える。

  2. 型を決め、value:NSCameraUsageDescriptionNSPhotoLibraryUsageDescriptionを加えれば、カメラへのアクセス、写真ライブラリーへのアクセスが可能になる。

方法

加え方は簡単でkeyのどれかにカーソルを合わせると+ボタンが出てくるのでそれをタップするとkeyの一覧が自動的に出てくる。

あとは追加したいkey、型、Valueを一覧から選ぶだけ。

参考

日本語情報が全然出てこなかったので書きました。下記のStackoverflowのリンクでより丁寧に方法を教えてくれているので英語で良いという方はこちらの方を参考にしてください。

NSPhotoLibraryUsageDescription key must be present in Info.plist to use camera roll

0
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0