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>

WDC2106 iOS10新特性及开发者要注意什么

iOS10相册相机闪退bug-b的更多相关文章

  1. iOS10相册相机闪退bug

    iOS10系统下调用系统相册.相机功能,遇到闪退的情况,描述如下: This app has crashed because it attempted to access privacy-sensit ...

  2. 解决关于ios访问相机闪退问题

    在mac上的ionic3项目打包成苹果app,系统版本是10.3.3 . 当调用相机的时候出现闪退情况,这是调试出现的问题: This app has crashed because it attem ...

  3. app保存图片到用户相册时闪退解决办法

    在iOS11中,app保存图片到用户相册时必须添加权限使用描述即NSPhotoLibraryAddUsageDescription,否则会闪退. 只需在info.plist—Property List ...

  4. cordova+vue打包ios调用相机闪退解决

    cordova+vue项目打包android,打开相机正常使用,但是打包ios后,需要多几个配置,才能打开,否则当调用的时候会闪退,上配置图 需要在选中的文件里面添加 <key>NSCam ...

  5. vs2017 .net core 项目调试浏览器网页闪退Bug

    from:https://blog.csdn.net/qq_36330228/article/details/82152187 vs更新2017最新版本后,项目调试浏览器莫名其妙出现闪退,每次都TMD ...

  6. 360浏览器导出Excel闪退BUG

    最近这半个月在疯狂的修改各种BUG,所以比较少更新博客. 现在谈谈这个360浏览器导出Excel的BUG的解决方法. 该BUG常出现在win7系统与xp系统导出Excel的瞬间关闭导出弹窗. 目前互联 ...

  7. Android 7.0 之后相机/文件读写等权限获取方式改变,导致开启相机闪退

    在 Android 7.0 之前 Google 提供的动态申请权限的 API,可以调用相机拍照,访问SDcard等操作都只需要申请对应的权限,如下: <uses-permission andro ...

  8. fastclick select 闪退 bug

    这时候needsclick就派上用场了 <select class='needsclick'></select> 附上fastclick github上的链接

  9. ios 真机使用相机闪退问题

    需要增加权限 在info文件增加 主要前面的key 后面的cameraDesciption只是一段描述 随便写就可以

随机推荐

  1. 304 CORS

    304响应, CORS问题: 没有 Access-Control-Allow-Origin 这个头信息时,以前次返回的200请求为准. 示例:可能已被删除 http://7af3zm.com1.z0. ...

  2. 4种处理excel文件的技术

    1.OLE Automation:处理excel文件会启动一个excel的进程,程序和excel进程通信来处理excel文件,这种方式占用服务器资源,不适合于网站的开发. 2.把Excel当成数据库, ...

  3. MVC3 Razor视图引擎的基础语法

    好久没有关注微软的开发了,今天看到了MVC3,顺便学习学习,我觉得Razor是个不错的做法,比使用<%%>简单多了,而且好看.首先“_”开头的cshtml文档将不能在服务器上访问,和asp ...

  4. C#之父 Anders Hejlsberg

             Anders Hejlsberg (born December 1960)[2] is a prominent Danish software engineer who co-des ...

  5. .net 调用webservice 总结

    最近做一个项目,由于是在别人框架里开发app,导致了很多限制,其中一个就是不能直接引用webservice . 我们都知道,调用webserivice 最简单的方法就是在 "引用" ...

  6. [老老实实学WCF] 第一篇 Hello WCF

    老老实实学WCF  第一篇 Hello WCF WCF(Windows Communication Foundation)是微软公司推出的面向服务技术的集大成者,涵盖继承了其之前发布的所有的分布式应用 ...

  7. C#颜色 转换

    C#Winform 使用16进制颜色 var color = ColorTranslator.FromHtml("#eeeeee");

  8. State模式

    地铁十字转门 状态迁移表格. 起始状态 触发迁移的事件 终止状态  要执行的动作. Locked   Coin               UnLocked UnLock UnLocked Pass  ...

  9. mfc110ud.dll not found

    mfc110ud.dll not found while debugging vs2012 MFC application. Possible Solutions: 1) >>>&g ...

  10. JS判断客户端是手机还是PC

    function IsPC() { var userAgentInfo = navigator.userAgent; var Agents = ["Android", " ...