iOS10相册相机闪退bug
iOS10系统下调用系统相册、相机功能,遇到闪退的情况,描述如下:
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.
修复方法:
在info.plist文件下添加
相机权限
<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>
相册权限
<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>
===========================
说法二
升级iOS10之后,在应用访问相册、相机、话筒、听筒的时候会发生崩溃。例如访问相机的时候xcode打印崩溃信息:
“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对于隐私权限的配置更为严格。但是我看不出来哪里好了,用着还不方便。
解决办法:
更改info.plist文件,可以直接用文本打开,添加:
<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>
<key>NSContactsUsageDescription</key>
<string>contactsDesciption</string>
<key>NSMicrophoneUsageDescription</key>
<string>microphoneDesciption</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>
也可以直接在xcode中更改:
这个string是我们开发者给起的一个表示,意思就是能随便写,但是要能表明其含义,它是给用户看的。第一次访问这些外设的时候会弹出提示框,上面就有显示这个string:
其它的权限key:
// 相机
NSCameraUsageDescription
// 相册
NSPhotoLibraryUsageDescription
// 麦克风:
NSMicrophoneUsageDescription
// 通信录
NSContactsUsageDescription
// 位置
NSLocationUsageDescription
// 日历
NSCalendarsUsageDescription
// 蓝牙
NSBluetoothPeripheralUsageDescription
// 媒体资料库
NSAppleMusicUsageDescription
// 提醒事项
NSRemindersUsageDescription
// 在使用期间访问位置
NSLocationWhenInUseUsageDescription
// 始终访问位置
NSLocationAlwaysUsageDescription
// 运动与健身
NSMotionUsageDescription
更多iOS10的特性参考官方文档:点击打开链接
==================================
iOS10闪退 崩溃1:
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.
意思是说:你需要在info.plist文件 添加一个“NSContactsUsageDescription ”的Key,Value添加一个描述。
需要在应用的info.plist里加入(使用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>
iOS10相册相机闪退bug的更多相关文章
- iOS10相册相机闪退bug-b
iOS10系统下调用系统相册.相机功能,遇到闪退的情况,描述如下: This app has crashed because it attempted to access privacy-sensit ...
- 解决关于ios访问相机闪退问题
在mac上的ionic3项目打包成苹果app,系统版本是10.3.3 . 当调用相机的时候出现闪退情况,这是调试出现的问题: This app has crashed because it attem ...
- app保存图片到用户相册时闪退解决办法
在iOS11中,app保存图片到用户相册时必须添加权限使用描述即NSPhotoLibraryAddUsageDescription,否则会闪退. 只需在info.plist—Property List ...
- cordova+vue打包ios调用相机闪退解决
cordova+vue项目打包android,打开相机正常使用,但是打包ios后,需要多几个配置,才能打开,否则当调用的时候会闪退,上配置图 需要在选中的文件里面添加 <key>NSCam ...
- vs2017 .net core 项目调试浏览器网页闪退Bug
from:https://blog.csdn.net/qq_36330228/article/details/82152187 vs更新2017最新版本后,项目调试浏览器莫名其妙出现闪退,每次都TMD ...
- 360浏览器导出Excel闪退BUG
最近这半个月在疯狂的修改各种BUG,所以比较少更新博客. 现在谈谈这个360浏览器导出Excel的BUG的解决方法. 该BUG常出现在win7系统与xp系统导出Excel的瞬间关闭导出弹窗. 目前互联 ...
- Android 7.0 之后相机/文件读写等权限获取方式改变,导致开启相机闪退
在 Android 7.0 之前 Google 提供的动态申请权限的 API,可以调用相机拍照,访问SDcard等操作都只需要申请对应的权限,如下: <uses-permission andro ...
- fastclick select 闪退 bug
这时候needsclick就派上用场了 <select class='needsclick'></select> 附上fastclick github上的链接
- ios 真机使用相机闪退问题
需要增加权限 在info文件增加 主要前面的key 后面的cameraDesciption只是一段描述 随便写就可以
随机推荐
- BZOJ 1934 [Shoi2007]Vote 善意的投票(最小割)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=1934 [题目大意] 每个人对于投票都有自己原来的观点:1或者0, 他可以违背自己原来的 ...
- BZOJ 1260 [CQOI2007]涂色paint(区间DP)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=1260 [题目大意] 假设你有一条长度为n的木版,初始时没有涂过任何颜色 每次你可以把一 ...
- 【贪心】Codeforces Round #407 (Div. 2) A. Anastasia and pebbles
贪心地一个一个尽可能往口袋里放,容易发现和顺序无关. #include<cstdio> #include<iostream> using namespace std; type ...
- 1.2(JavaScript学习笔记)JavaScript HTML DOM
一.DOM DOM全称为document object model(文档对象模型). 此处的文档指当前HTML文档,对象指HTML标签. 当网页被加载时,浏览器会创建页面的文档对象模型. 下面结合具体 ...
- go排序后索引
最近碰上了一个需求,要得到排序后的原索引序列. 我又不希望自己重新实现一快排出来,所以在接口上重新封装了一下. package main import ( "fmt" " ...
- Net编程 详解DataTable用法【转】
http://www.diybloghome.com/article/16.html DataTable表示一个与内存有关的数据表,可以使用工具栏里面的控件拖放来创建和使用,也可以在编写程序过程中根据 ...
- Python学习之路上的几个经典问题
1.python有三元运算符语法(类似C语言的"?")么? 语法如下: [on_true] if [expression] else [on_false] 如果[expressio ...
- KafkaConsumer对于事务消息的处理
Kafka添加了事务机制以后,consumer端有个需要解决的问题就是怎么样从收到的消息中滤掉aborted的消息.Kafka通过broker和consumer端的协作,利用一系列优化手段极大地降低了 ...
- 异常解决:util.NativeCodeLoader: Unable to load native-hadoop library for your platform
内容源自:点此链接 刚装好hadoop的时候,每次输入命令运行都会出现: WARN util.NativeCodeLoader: Unable to load native-hadoop librar ...
- 用户手册是Yasm汇编
本文档的用户手册是Yasm汇编. 它是介绍和通用所有Yasm用户参考. 英文的参考:http://www.cnblogs.com/coryxie/p/3959888.html 1 .介绍 Yasm b ...