iOS 10权限崩溃问题

it2022-05-09  26

手机升级到iOS10 Beta版本后,再次进行真机调试时会遇见权限崩溃问题,崩溃原因如下:This app has crashed because it attempted to access privacy-sensitive data without a usage description.  The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data  意思是说:你需要在info.plist文件 添加一个“NSContactsUsageDescription ”的Key,Value添加一个描述。

修改方法如下:

1,在项目中找到info.plist文件,右击有个 Open As,以Source Code 的形式打开

2,分别复制 以下 Value 和Key,Key 一定不能错,Value 貌似可以随便填写

相机权限描述:

    <key>NSCameraUsageDescription</key>    <string>cameraDesciption</string>

通信录:    <key>NSContactsUsageDescription</key>    <string>contactsDesciption</string>

麦克风:    <key>NSMicrophoneUsageDescription</key>    <string>microphoneDesciption</string>

相机:    <key>NSPhotoLibraryUsageDescription</key>    <string>photoLibraryDesciption</string>

3,在info.plist 文件上 复制上,然后 保存,如下图:

Source Code 的形式:

4,Clean之后,运行就OK了。

转载于:https://www.cnblogs.com/Yun-Longcom/p/5941107.html

相关资源:数据结构—成绩单生成器

最新回复(0)