iOS10相册相机闪退bug-b
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-b的更多相关文章
- iOS10相册相机闪退bug
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只是一段描述 随便写就可以
随机推荐
- asp.net MVC dropList 绑定
废话我就不多说了..上个图.给自己备忘一下
- js 实现angylar.js view层和model层双绑定(改变view刷新 model,改变model自动刷新view)
近段时间研究了下angular.js 觉得它内部实现的view和model层之间存在很微妙的关系,如下图 如上图说的,view的改变会update 数据层model, 数据层会update视图层vie ...
- django 学习-13 Django文件上传
1..vim blog/views.py from django import formsfrom django.http import HttpResponse 1 2 from dja ...
- FusionCharts Free 注意事项
前段时间做的项目中用到了FusionCharts Free 这个插件,今天上班打开网站后竟然发现线形图出错了,如图: Y轴都是 NaNM ,经过在网上的一番查询后终于得知为什么了. 原来Free 版本 ...
- Android开发的十项注意
随着移动平台的发展及其应用的不断改善,质量成为决定成败的关键.用户要求他们安装的应用响应快.性能好,如果某个应用不能提供卓越的功能和稳定的用户体验,那注定会被很快卸载: 尽管现在Android智能手机 ...
- Android DiffUtil
Android 的recyclerview-v7:24.2.0 发布后多了个DiffUtil工具类,这个工具类能够大大解放了Android开发者的一个苦恼:RecyclerView局部刷新和重新刷新时 ...
- 在sql设计中没法修改表结构
在做练习的时候经常表没设计好,后来有要去数据库修改表结构但是没词用界面修改的时候都会提示要保存 转自http://www.57xue.com/ItemView/Sql/2016061600160.ht ...
- Chrome JS内存泄漏排查方法(Chrome Profiles)
原文网址:http://blog.csdn.net/kaitiren/article/details/19974269 JS内存泄漏排查方法(Chrome Profiles) Google Ch ...
- 解决windows端口被占用
1, Cmd输入命令:netstat –ano|findstr “端口号” ,如netstat –ano|findstr “8080” 记下PID,最后一行为PID,这里为396 2,Cmd输 ...
- Elementary os的安装
1. 使用安装文件进行数据读取 2. 进入安装界面 3. 选择语言并进行安装(可以先试用) 4. 选择继续(可以勾选两个选项,意思是 ...