iOS 10訪問相機Crash,plist許可權設定
阿新 • • 發佈:2019-02-06
在iOS 10的上訪問相機Crash,打印出以下錯誤資訊
錯誤資訊:This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.
原因:iOS 10的許可權問題
解決:在 info.plist
也可右鍵點選以
Source Code
形式開啟,新增如下:
<key>NSPhotoLibraryUsageDescription</key>
<string>請點選“允許”以允許訪問。</string>
<key>NSCameraUsageDescription</key>
<string>請點選“允許”以允許訪問。</string>
<key>NSAppleMusicUsageDescription</key>
<string >請點選“允許”以允許訪問。</string>
<key>NSMicrophoneUsageDescription</key>
<string>請點選“允許”以允許訪問。</string>
附可能涉及到的許可權: