iOS10

作者: 半江瑟瑟 | 来源:发表于2016-12-16 11:12 被阅读243次

    XCODE8 iOS10控制台打印如下问题
    nwlog simulate crash inner block invoke dlopen CrashReporterSupport failed
    nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:

    解决方法

    1. 到 Edit Scheme (快捷键 command + shift + <)

    2.选择 Arguments 选项

    3.添加变量 OS_ACTIVITY_MODE = disable

    Paste_Image.png Paste_Image.png

    模拟器问题Failed to chmod /Users/jiangweike/Library/Developer/CoreSimulator/Devices/9C834755-B9C5-4861-BEDA-3D55E2F8F38D/data/Library/Caches/com.apple.containermanagerd/Bundle/Application/B4D1D665-8793-4F07-AF29-D5E3D68F3D5C/AJPhotoPickerExample.app/AJPhotoPickerExample : No such file or directory
    解决方法 重启模拟器


    Paste_Image.png

    pod第三方之后,真机编译报错
    Pods was rejected as an implicit dependency for 'libPods.a' because its architectures '' didn't contain all required architectures 'XXX'
    Target 'XX' of project 'Pods' was rejected as an implicit dependency for 'libPods-XX.a' because its architectures 'arm64' didn't contain all required architectures 'armv7 arm64'
    解决方法:targets-> app, then Build Settings,Tried to set Architectures to standard (armv7, armv7s, arm64), set Build Active Architecture Only (Debug) to Yes.

    我发现设置完YES之后编译成功再次设置为NO,也只会警告不会报错了.


    Paste_Image.png

    iOS10增加了访问权限设置 媒体库那几个需要在info.plist加上,不然会有莫名的错误...(有时候不会报具体的可分析的错误,会报红色bad指针的问题!或者直接闪退!)
    崩溃:[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.
      这个是拍照动作引起的崩溃,在升Xcode+iOS10之前都是好的,升级之后,需要在plist文件中添加相册****权限。相应的麦克风,通讯录,如果项目中涉及到了,也需要添加相应的权限。报错的相应key值:
      通信录:****NSContactsUsageDescription
      麦克风:NSMicrophoneUsageDescription
    ****  相册:NSPhotoLibraryUsageDescription****

      这里仅以相册的为例:
      plist文件里面添加,Privacy - Photo Library Usage Description,Value值为描述,弹出的提示框会显示出来。

        升到iOS10之后,需要设置权限的有:
    麦克风权限:Privacy - Microphone Usage Description 是否允许此App使用你的麦克风?
    相机权限: Privacy - Camera Usage Description 是否允许此App使用你的相机?
    相册权限: Privacy - Photo Library Usage Description 是否允许此App访问你的媒体资料库?
    通讯录权限: Privacy - Contacts Usage Description 是否允许此App访问你的通讯录?
    蓝牙权限:Privacy - Bluetooth Peripheral Usage Description 是否许允此App使用蓝牙?
    语音转文字权限:Privacy - Speech Recognition Usage Description 是否允许此App使用语音识别?
    日历权限:Privacy - Calendars Usage Description
    定位权限:Privacy - Location When In Use Usage Description
    定位权限: Privacy - Location Always Usage Description
    位置权限:Privacy - Location Usage Description
    媒体库权限:Privacy - Media Library Usage Description
    健康分享权限:Privacy - Health Share Usage Description
    健康更新权限:Privacy - Health Update Usage Description
    运动使用权限:Privacy - Motion Usage Description
    音乐权限:Privacy - Music Usage Description
    提醒使用权限:Privacy - Reminders Usage Description
    Siri使用权限:Privacy - Siri Usage Description
    电视供应商使用权限:Privacy - TV Provider Usage Description
    视频用户账号使用权限:Privacy - Video Subscriber Account Usage Description
    (电视供应商使用权限和视频用户账号使用权限冲突!!!好像就是一个东西啊,反正添加就冲突!,都对应<key>NSVideoSubscriberAccountUsageDescription</key>)

    Paste_Image.png

    <key>NSCameraUsageDescription</key>
    <string>是否允许此App使用你的相机?</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>是否允许此App访问你的相册资源库?</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>是否允许此App使用你的麦克风?</string>
    <key>NSContactsUsageDescription</key>
    <string>是否允许此App访问你的通讯录?</string>
    <key>NSBluetoothPeripheralUsageDescription</key>
    <string>是否许允此App使用蓝牙?</string>
    <key>NSSpeechRecognitionUsageDescription</key>
    <string>是否允许此App使用语音识别?</string>
    <key>NSCalendarsUsageDescription</key>
    <string>是否允许此App使用日历?</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>是否允许此App需要时能通过您的地理位置信息获取您周边的相关数据?</string>
    <key>NSLocationAlwaysUsageDescription</key>
    <string>是否允许此App总是通过您的地理位置信息获取您周边的相关数据?</string>
    <key>NSLocationUsageDescription</key>
    <string>是否允许次App访问你的地理位置?</string>
    <key>NSAppleMusicUsageDescription</key>
    <string>是否允许此App访问你的媒体库?</string>
    <key>NSHealthShareUsageDescription</key>
    <string>是否允许此App访问你的健康分享?</string>
    <key>NSHealthUpdateUsageDescription</key>
    <string>是否允许此App访问你的健康更新?</string>
    <key>NSMotionUsageDescription</key>
    <string>是否允许此App访问你的运动权限?</string>
    <key>kTCCServiceMediaLibrary</key>
    <string>是否允许此App访问你的音乐?</string>
    <key>NSRemindersUsageDescription</key>
    <string>是否允许此App访问你的提醒?</string>
    <key>NSSiriUsageDescription</key>
    <string>是否允许此App访问你的Siri?</string>
    <key>NSVideoSubscriberAccountUsageDescription</key>
    <string>是否允许此App访问你的电视供应商?</string>

    相关文章

      网友评论

          本文标题:iOS10

          本文链接:https://www.haomeiwen.com/subject/gwdnmttx.html