Crashing at AccountStore.Create ().Save (e.Account

2019-02-21 23:08发布

In the Xamarin.Forms example ToDoAwsAuth at

https://developer.xamarin.com/guides/xamarin-forms/web-services/authentication/oauth/

After successful login, in aOnAuthenticationCompleted event, the application is crashing when trying to save to Xamarin.Auth at

AccountStore.Create ().Save (e.Account, "ToDoList");

The error says not able to say to keychain

Looking forward for help.

3条回答
2楼-- · 2019-02-21 23:31

Just add empty Entitlements.plist to your iOS app project.

Select(iOS App Project) /+ File /+ New File /+ iOS /+ Entitlements.plist

Note: this seems to be result of one bug in Xamarin.Auth and Apple's changes in iOS 10 SDK (some report bug in simulator).

Xamarin.Auth fix will be released within next few hours (CI servers) in nuget version 1.3.3-alpha-01

Similar error (bug in Xamarin.Auth) can happen if the authentication is performed while the screen is being locked. PR 80

Related:

https://github.com/xamarin/Xamarin.Auth/issues/128
https://bugzilla.xamarin.com/show_bug.cgi?id=43514

https://github.com/xamarin/Xamarin.Auth/pull/80

查看更多
劳资没心,怎么记你
3楼-- · 2019-02-21 23:36

See if you have a file called Entitlements.plist if so click on it and check Enable Keychain

Capabilities

or

create a new file names Entitlements.plist with the following content then drag and drop it on your project

<?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>
    <key>keychain-access-groups</key>
    <array>
        <string>your bundle id</string>
    </array>
</dict>
</plist>
  • Right click on your project

  • Choose Options

  • Choose iOS Bundle Signing

  • Choose Entitlements.plist

xam studio options

Thats all then it should be fine !

查看更多
爱情/是我丢掉的垃圾
4楼-- · 2019-02-21 23:48

Looks like this is a bug in Xamarin.Auth as per this

https://github.com/xamarin/Xamarin.Auth/issues/128

查看更多
登录 后发表回答