0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Xcode】パーミッションリクエストが反映されない

Posted at

問題

NSPhotoLibraryAddUsageDescriptionを記述しているにも関わらず、記述されていない判定でクラッシュする
スクリーンショット 2022-07-28 18.15.30.png

This app has crashed because it attempted to access privacy-sensitive data without a usage description.  The app's Info.plist must contain an NSPhotoLibraryAddUsageDescription key with a string value explaining to the user how the app uses this data.

スクリーンショット 2022-07-28 18.14.32.png

原因

SwiftUIはXcode13からデフォルトでInfo.plistが表示されなくなりました。
ですので、Info.plistの編集はこちらから行います。
スクリーンショット 2022-07-28 18.44.36.png

しかし、1度編集を行うとプロジェクト内にInfo.plistファイルが生成されます。
スクリーンショット 2022-07-28 18.47.08.png

こちらからNSPhotoLibraryAddUsageDescriptionを追加しても反映されていませんでした。
スクリーンショット 2022-07-28 18.47.58.png

解決方法

ターケット内のInfoからパーミッションリクエストを記述する
スクリーンショット 2022-07-28 18.49.48.png

おわり

おそらくバグです

0
2
0

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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?