当前位置:首页 > 通信资讯 > 正文

今天 手机升级了 ios10 beta,然后用正在开发的项目 装了个ipa包,发现点击有关 权限访问 直接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 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>

eg:其他权限描述,debug 控制台都会有输出的,自行添加就ok

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

source code 的形式:

ios10 解决权限崩溃问题详解(ios10 解决权限崩溃问题详解)

property list 的展现形式:

ios10 解决权限崩溃问题详解(ios10 解决权限崩溃问题详解)

4,clean之后,运行就ok了

通过此文希望能帮助到大家解决ios10 权限崩溃的问题,谢谢大家对本站的支持!

如果您对该产品感兴趣,请填写办理(客服微信:xiaoxiongyidong)

为您推荐:

发表评论

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。