Xamarin Auth Store Keychain not working after ios10 upgrade

霸气de小男生 提交于 2019-11-27 21:50:30

I was digging through the link Pat sent in the comment: bugzilla.xamarin.com/show_bug.cgi?id=43514

And found a helpfull comment by Pavel Sich, he said:

Just make sure you enable the keychain access in Entitlements and select the entitlements for Simulator (Debug) builds too. By default this is not set.

In my xamarin solution, I double clicked the .IOS project to open the options pane, selected IOS Bundle Signing and changed the Platform select box from "iPhone" to "iPhoneSimulator", then set the field Custom Entitlements to my Entitlements.plist. Now it's working fine for me.

Just a note, this is after editing the Entitlement.plist as suggested by Thibault D. in the previous answer.

Hope this helps.

Thibault D.

According to this thread it's enough that you add an empty entitlements file in you bundle singing configuration:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
  ...
  <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
</PropertyGroup>

Empty Entitlements.plist file:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

It seems that when you work on IphoneSimulator even you enabled KeyChain in Entitlements.plist, it still doesnt work and throws this exception. Because Xamarin doesnt seem to have CodesignEntitlements sets for IphoneSimulator configuration as default although it has for Iphone configurations. You have to open your IOS.csproj file and manually add this line

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">

  <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
</PropertyGroup>

Set Custom Entitlements in ios project settings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!