ios [access] This app has crashed because ……
来源:互联网 发布:全球懂英语的人数 知乎 编辑:程序博客网 时间:2024/06/11 13:28
问题出现描述:项目在开发时使用的是Xcode7,后来维护项目时使用Xcode8.2打开运行,发现在通讯录中报错如下:
2017-xx-xx xx:xx:xx.xxxxxx xx[6077:133155] [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 NSContactsUsageDescription key with a string value explaining to the user how the app uses this data.
同时发现调用相册时也会有类似问题,报错如下:
2017-xx-xx xx:xx:xx.xxxxxx xx[6077:133155] [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.
(lldb)
as错误信息译文分别是
1: 此应用程序崩溃,因为它试图访问隐私敏感的数据,而无需使用说明。应用程序的Info.plist必须包含一个字符串值,解释如何使用这些数据的应用程序的用户NSContactsUsageDescription关键。
2: 此应用程序崩溃,因为它试图访问隐私敏感的数据,而无需使用说明。应用程序的Info.plist必须包含一个字符串值,解释如何使用这些数据的应用程序的用户NSPhotoLibraryUsageDescription关键。
这个问题解决是要配置文件Info.plist中添加信息描述。在理解一下swift3.0代码略有变化,我在网上查阅资料发现这个问题出现的原因,原来由于开发工具升级,要求在访问通讯录、相机、相册等权限时,需要在配置文件Info.plist中添加描述,我的解决问题添加描述如下图:
以上分别为通讯录权限描述、相册权限描述、相机权限描述。
使用xml格式代码展示如下:
<key>NSContactsUsageDescription</key><string>contactsDesciption</string><key>NSPhotoLibraryUsageDescription</key><string>photoLibraryDesciption</string><key>NSCameraUsageDescription</key><string>cameraDesciption</string>在配置文件Info.plist中添加描述信息,可以直接输入Privacy,会有目录提示,可以找到你要的权限,如图:
以上是我开发过程中遇到的问题以及解决办法,在此分享,如有疏漏错误或是疑问,欢迎评论告知。
- ios [access] This app has crashed because ……
- This app has crashed because it attempted to access privacy-sensitive data without a usage descripti
- This app has crashed because it attempted to access privacy-sensitive data without a usage descripti
- This app has crashed because it attempted to access privacy-sensitive data without a usage descripti
- MarkdownPad this view has crashed
- Cannot access individual rows in this collection because the table has vertically merged cells c#
- This view has crashed Markdown的渲染问题
- Xcode8使用出现This app has attempted to access privacy-sensitive data without a usage description.
- iOS 最新提示Unable to add App ID because the '10' App ID limit in '7' days has been exceeded.
- MarkdownPad 2 在win10下html渲染错误This view has crashed
- 解决MarkdownPad2在win10下html渲染错误This view has crashed
- MarkdownPad 2 在win10下html渲染错误This view has crashed
- win10安装MarkdownPad 2报错This view has crashed的处理及md简单语法
- MarkdownPad 2 在win10下html渲染错误This view has crashed
- App Crashed 记录
- MarkdownPad 2 在win10下出错:HTML 渲染错误(This view has crashed) 的解决办法 + MarkdownPad2.5 注册码
- MarkdownPad 2 在win10下出错:HTML 渲染错误(This view has crashed) 的解决办法 + MarkdownPad2.5 注册码
- MarkdownPad 2 在win10下出错:HTML 渲染错误(This view has crashed) 的解决办法 + MarkdownPad2.5 注册码
- ClassNotFoundException问题解决
- phpstorm编码设置
- 镜像站--google
- 测试思想-集成测试 关于接口测试 Part 1
- Oracle字符集转换
- ios [access] This app has crashed because ……
- ODPS Tunnel download
- Unity T4M 中文讲解
- UDP端口测试
- iOS架构设计(解耦的尝试)之UI样式复用与布局管理
- JAVA HttpURLConnection Post方式提交传递参数
- 使用windows10+linphone-desktop最新版 编译linphone PC版
- 1011. World Cup Betting (20)
- Error: Cannot find module 'gulp-clone'问题的解决