KeychainItemWrapper crash on iOS10

点点圈 提交于 2019-12-05 10:10:45

It looks like a bug; a bug report has been filed, but there's a workaround. Just enable "Keychain Sharing" (under your app -> Capabilities tab in Xcode). See https://forums.developer.apple.com/thread/51071 for full background.

Edit: Ignore what I was rambling about... duh, forgot that under the project target's Capabilities tab I have also enabled Keychain sharing... Though still would like to get a deeper, more cogent answer.

So guess you can ignore this... but leaving here just in case you run into the privacy stuff (though that's another SO question which I'm sured has been answered elsewhere):

Yeah, I had the same problem (also with asking for location crashing)... looks like a change in iOS 10 regarding privacy and services. Strangely in my case adding the keys below this comment to the info.plist (or via Xcode you'll see them with "Privacy-*")

Funny thing is that suddenly keychain access worked just fine, even though none of these keys have anything to do with keychain access... I'm still digging more into that so I can provide a "real answer", but hopefully this can unblock you for now.

Here's what I added (note don't think you need all of them, but just to ensure my answer matches what I did):

<key>LSApplicationCategoryType</key>
<string></string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>health devices</string>
<key>NSRemindersUsageDescription</key>
<string>medication reminders</string>
<key>NSMicrophoneUsageDescription</key>
<string>calls</string>
<key>NSCameraUsageDescription</key>
<string>Allow Moonshot to use the camera (profile and calls)</string>
<key>NSMotionUsageDescription</key>
<string>Allow Moonshot to use motion to track activity</string>
<key>NSLocationUsageDescription</key>
<string>Allow Moonshot to use location to track activity</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Allow Moonshot to always use location (to track activity)</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Allow Moonshot to use location while in use (to track activity)</string>
<key>CFBundleDevelopmentRegion</key>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!