System.Exception: Could not save account to KeyChain: -34018 on iOS Simulator 7 OS 10.1 #133
Comments
@ericbrunner You need to enable "Enable Keychain Access Groups"
ref: http://stackoverflow.com/questions/39487368/xamarin-auth-store-keychain-not-working-after-ios10-upgrade |
@sushihangover Thanks . According to the 1st SO ref it was enough to add an empty entitlements file to the bundle signing configuration:
Empty Entitlements.plist file:
|
Closing. References (duplicates):
AnalysisThis problem is not Xamarin related: seems like this is bug in iOS 10 simulator and XCode (8.x). https://forums.developer.apple.com/thread/4743?tstart=0 [Re]Solution / WorkaroundIf not present create empty Entitlements.plist <?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> Entitlements.plist must be added to iOS Bundle Signing options for the
This will result in following code in *.csproj file: <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG;ENABLE_TEST_CLOUD;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchArch>ARMv7, ARM64</MtouchArch>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchFloat32>true</MtouchFloat32>
<CodesignKey>iPhone Developer</CodesignKey>
<DeviceSpecificBuild>true</DeviceSpecificBuild>
<MtouchDebug>true</MtouchDebug>
<MtouchProfiling>true</MtouchProfiling>
<IpaPackageName>
</IpaPackageName>
</PropertyGroup> while default *.csproj file looks like this <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG;ENABLE_TEST_CLOUD;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<DeviceSpecificBuild>true</DeviceSpecificBuild>
<MtouchDebug>true</MtouchDebug>
<MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
<MtouchFastDev>true</MtouchFastDev>
<IOSDebuggerPort>50317</IOSDebuggerPort>
<MtouchLink>None</MtouchLink>
<MtouchArch>i386, x86_64</MtouchArch>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
</PropertyGroup> NOTE: difference is in this file: <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
Hi,
Only on iOS Simulator I get that exception.
iOS Init
AccountStore = AccountStore.Create();
iOS Usage
var account = new Account(user.UserId); account.Properties.Add("token", user.MobileServiceAuthenticationToken); AccountStore.Save(account, TruckerAppKeyStoreKey);
The text was updated successfully, but these errors were encountered: