iOS 10出來之后,真是很多坑啊,填完一個又來一個,今天又遇到了一個,用Xcode8.0上傳項目時被駁回說是info.plist里面沒有設置NSPhotoLibraryUsageDescription、NSCameraUsageDescription、NSContactsUsageDescription、NSMicrophoneUsageDescription等字段,之前這些都是預設的不用加,現(xiàn)在強制了,真是郁悶,下面貼上解決方案
被駁回的原因:
This app attempts 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.
This app attempts 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.
意思就是得在plist里面必須加上NSPhotoLibraryUsageDescription和NSCameraUsageDescription的鍵值對才行,之前都是默認的,現(xiàn)在必須加,要不不讓通過,具體配置如下圖:

info.png
也可以找到項目的info.plist文件,右擊選中Open As -> source code 添加如下代碼:
相機權限描述:
<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>
通信錄:
<key>NSContactsUsageDescription</key>
<string>contactsDesciption</string>
麥克風:
<key>NSMicrophoneUsageDescription</key>
<string>microphoneDesciption</string>
相機:
<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>
其中,如果把<string>photoLibraryDesciption</string>中間photoLibraryDesciption去掉也可以,個人覺得更加簡潔好看。
就這樣就解決權限問題啦,不過如果實在還不行,你可以試試Clean,再運行就OK啦