ios 10问题的解决方法
2016-10-13 16:46
302 查看
1、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.
修复方法:
(1)在info.plist文件下添加一下代码:
相机权限
<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>
相册权限
<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>
在网上还有一个说法,跟上述几乎一样只不过多设置了两项权限:
(2)你需要在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>
2、iOS10因苹果健康导致闪退crash
如果在app中调用了苹果健康,iOS10中会出现闪退。控制台报错的原因是:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSHealthUpdateUsageDescription must be set in the app's Info.plist in order to request write authorization.'
这是因为我们要在info.plist文件中声明苹果的使用权限,所以在info.plist中添加一下key就可以l
请求写入:
<key>NSHealthUpdateUsageDescription</key>
<string>some string value stating the reason</string>
请求读取
<key>NSHealthShareUsageDescription</key>
<string>some string value stating the reason</string>
另外附加一些其他权限描述:
相机权限描述:
<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>
通讯录
<key>NSContactsUsageDescription</key>
<string>contactsDesciption</string>
麦克风
<key>NSMicrophoneUsageDescription</key>
<string>microphoneDesciption</string>
相机
<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>
3、iOS10配置须知
在iOS10中,如果你的App想要访问用户的相机、相册、麦克风、通讯录等等权限,都需要进行相关的配置,不然会直接crash。
需要在info.plist中添加App需要的一些设备权限。
NSBluetoothPeripheralUsageDescription
访问蓝牙
NSCalendarsUsageDescription
访问日历
NSCameraUsageDescription
相机
NSPhotoLibraryUsageDescription
相册
NSContactsUsageDescription
通讯录
NSLocationAlwaysUsageDescription
始终访问位置
NSLocationUsageDescription
位置
NSLocationWhenInUseUsageDescription
在使用期间访问位置
NSMicrophoneUsageDescription
麦克风
NSAppleMusicUsageDescription
访问媒体资料库
NSHealthShareUsageDescription
访问健康分享
NSHealthUpdateUsageDescription
访问健康更新
NSMotionUsageDescription
访问运动与健身
NSRemindersUsageDescription
访问提醒事项
暂时先总结这么多,继续搜集……
停下休息的时候不要忘记别人在奔跑!
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.
修复方法:
(1)在info.plist文件下添加一下代码:
相机权限
<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>
相册权限
<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>
在网上还有一个说法,跟上述几乎一样只不过多设置了两项权限:
(2)你需要在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>
2、iOS10因苹果健康导致闪退crash
如果在app中调用了苹果健康,iOS10中会出现闪退。控制台报错的原因是:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSHealthUpdateUsageDescription must be set in the app's Info.plist in order to request write authorization.'
这是因为我们要在info.plist文件中声明苹果的使用权限,所以在info.plist中添加一下key就可以l
请求写入:
<key>NSHealthUpdateUsageDescription</key>
<string>some string value stating the reason</string>
请求读取
<key>NSHealthShareUsageDescription</key>
<string>some string value stating the reason</string>
另外附加一些其他权限描述:
相机权限描述:
<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>
通讯录
<key>NSContactsUsageDescription</key>
<string>contactsDesciption</string>
麦克风
<key>NSMicrophoneUsageDescription</key>
<string>microphoneDesciption</string>
相机
<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>
3、iOS10配置须知
在iOS10中,如果你的App想要访问用户的相机、相册、麦克风、通讯录等等权限,都需要进行相关的配置,不然会直接crash。
需要在info.plist中添加App需要的一些设备权限。
NSBluetoothPeripheralUsageDescription
访问蓝牙
NSCalendarsUsageDescription
访问日历
NSCameraUsageDescription
相机
NSPhotoLibraryUsageDescription
相册
NSContactsUsageDescription
通讯录
NSLocationAlwaysUsageDescription
始终访问位置
NSLocationUsageDescription
位置
NSLocationWhenInUseUsageDescription
在使用期间访问位置
NSMicrophoneUsageDescription
麦克风
NSAppleMusicUsageDescription
访问媒体资料库
NSHealthShareUsageDescription
访问健康分享
NSHealthUpdateUsageDescription
访问健康更新
NSMotionUsageDescription
访问运动与健身
NSRemindersUsageDescription
访问提醒事项
暂时先总结这么多,继续搜集……
停下休息的时候不要忘记别人在奔跑!
相关文章推荐
- 使用IOS 10 / XCODE 8.1 遇到 libsystem_kernel.dylib`__abort_with_payload问题的解决方法
- Xcode 9下适配iPhoneX导致iOS 10不兼容问题的解决方法
- 高德IOS真机调试LMAMapKit出错问题的解决方法(directory not found for option)
- [iOS] performSelector:withObject:afterDelay:调用没有作用的问题及解决方法
- iOS学习笔记24—URL传参的问题和解决方法
- Xcode做ios开发时 message sent to deallocated instance问题的解决方法(gdb和lldb)
- IOS开发遇到的问题和解决方法
- 打开键盘遮住View的问题解决方法-IOS开发
- 打开键盘遮住View的问题解决方法-IOS开发
- iOS7下status bar相关问题的解决方法
- iPhone开发笔记(21)iOS 6旋转问题解决方法汇总
- 个人在iOS开发过程中真机调试遇到的问题及解决方法 推荐
- Ubuntu 10_04 安装在 VMware Workstation 后,登录界面键盘无法输入的问题的解决方法
- 打开键盘遮住View的问题解决方法-IOS开发
- cocos2d-x中CCEditBox 在iOS和安卓平台下 位置偏移的问题解决方法
- 打开键盘遮住View的问题解决方法-IOS开发
- ArcGIS 10中WFS缓存问题的解决方法与原理
- Altium Designer 10常见问题及解决方法
- IOS开发键盘弹出时遮住输入框的问题的一种解决方法。
- iPhone开发笔记(21)iOS 6旋转问题解决方法汇总