崩潰:[access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.app
這個是拍照動做引發的崩潰,在升Xcode+iOS10以前都是好的,升級以後,須要在plist文件中添加相冊權限。相應的麥克風,通信錄,若是項目中涉及到了,也須要添加相應的權限。報錯的相應key值:ide
通訊錄:NSContactsUsageDescriptionthis
麥克風:NSMicrophoneUsageDescriptioncode
相冊:NSPhotoLibraryUsageDescription視頻
這裏僅以相冊的爲例:ip
plist文件裏面添加,Privacy - Photo Library Usage Description,Value值爲描述,彈出的提示框會顯示出來。string
升到iOS10以後,須要設置權限的有:it
- 麥克風權限:Privacy - Microphone Usage Description 是否容許此App使用你的麥克風?
- 相機權限: Privacy - Camera Usage Description 是否容許此App使用你的相機?
- 相冊權限: Privacy - Photo Library Usage Description 是否容許此App訪問你的媒體資料庫?
- 通信錄權限: Privacy - Contacts Usage Description 是否容許此App訪問你的通信錄?
- 藍牙權限:Privacy - Bluetooth Peripheral Usage Description 是否許允此App使用藍牙?
- 語音轉文字權限:Privacy - Speech Recognition Usage Description 是否容許此App使用語音識別?
- 日曆權限:Privacy - Calendars Usage Description
- 定位權限:Privacy - Location When In Use Usage Description
- 定位權限: Privacy - Location Always Usage Description
- 位置權限:Privacy - Location Usage Description
- 媒體庫權限:Privacy - Media Library Usage Description
- 健康分享權限:Privacy - Health Share Usage Description
- 健康更新權限:Privacy - Health Update Usage Description
- 運動使用權限:Privacy - Motion Usage Description
- 音樂權限:Privacy - Music Usage Description
- 提醒使用權限:Privacy - Reminders Usage Description
- Siri使用權限:Privacy - Siri Usage Description
- 電視供應商使用權限:Privacy - TV Provider Usage Description
- 視頻用戶帳號使用權限:Privacy - Video Subscriber Account Usage Description