Error -34018 (errSecDefault) #52

Closed
tonyxiao opened this Issue Dec 3, 2013 · 111 comments

Comments

Projects
None yet
@tonyxiao

tonyxiao commented Dec 3, 2013

Sometimes I'd see the following error

(lldb) po error
Error Domain=com.samsoffes.sskeychain Code=-34018 "errSecDefault" UserInfo=0x17d3f070 {NSLocalizedDescription=errSecDefault}

But I have no idea what errSecDefault (code -34018) means nor how to resolve it. Any ideas?

@aspyct

This comment has been minimized.

Show comment
Hide comment
@aspyct

aspyct Jan 22, 2014

As an additional information, we have the same problem in our project, which doesn't use SSKeychain. We started experiencing the problem with iOS7 only with the test runs. Right now, about a month later, we discovered that we have the same problem with an iPad mini 1 running iOS 6.1. But it works with an iPhone 4S running the same OS version.

If you have any ideas, I'd be interested. I'm also open to contributing to this issue, as we're experiencing the same problem, but this will be planning-constrained.

iPhone 5S, iOS7: fail
iPhone 5C, iOS7: fail
iPhone 4S, iOS7: fail
iPad mini 1, iOS6: fail
iPhone 4S, iOS6: success

aspyct commented Jan 22, 2014

As an additional information, we have the same problem in our project, which doesn't use SSKeychain. We started experiencing the problem with iOS7 only with the test runs. Right now, about a month later, we discovered that we have the same problem with an iPad mini 1 running iOS 6.1. But it works with an iPhone 4S running the same OS version.

If you have any ideas, I'd be interested. I'm also open to contributing to this issue, as we're experiencing the same problem, but this will be planning-constrained.

iPhone 5S, iOS7: fail
iPhone 5C, iOS7: fail
iPhone 4S, iOS7: fail
iPad mini 1, iOS6: fail
iPhone 4S, iOS6: success

@calebd

This comment has been minimized.

Show comment
Hide comment
@calebd

calebd Jan 22, 2014

Collaborator

Are you guys using access groups or iCloud syncing? Error -34108 is defined in SecBasePriv.h as "missing entitlement".

Collaborator

calebd commented Jan 22, 2014

Are you guys using access groups or iCloud syncing? Error -34108 is defined in SecBasePriv.h as "missing entitlement".

@aspyct

This comment has been minimized.

Show comment
Hide comment
@aspyct

aspyct Jan 24, 2014

Nope, none of the two.

aspyct commented Jan 24, 2014

Nope, none of the two.

@iwasrobbed

This comment has been minimized.

Show comment
Hide comment
@iwasrobbed

iwasrobbed Mar 15, 2014

👍 Just started seeing the same issue consistently after upgrading to iOS 7.1 SDK. By the way, this only happens in a testing environment running the app through KIF on a device. If I run normally, it works just fine and it also works fine on the simulator during test.

This seemed to fix it for me during test: http://stackoverflow.com/a/22305193/308315

👍 Just started seeing the same issue consistently after upgrading to iOS 7.1 SDK. By the way, this only happens in a testing environment running the app through KIF on a device. If I run normally, it works just fine and it also works fine on the simulator during test.

This seemed to fix it for me during test: http://stackoverflow.com/a/22305193/308315

@soffes

This comment has been minimized.

Show comment
Hide comment
@soffes

soffes Mar 16, 2014

Owner

PRs welcome :)

Owner

soffes commented Mar 16, 2014

PRs welcome :)

@TedAvery

This comment has been minimized.

Show comment
Hide comment
@TedAvery

TedAvery Apr 30, 2014

👍 Happening to me as well on iOS 7.1.1, but very sporadically, can't find a way to recreate it myself.

👍 Happening to me as well on iOS 7.1.1, but very sporadically, can't find a way to recreate it myself.

@rsanchezsaez

This comment has been minimized.

Show comment
Hide comment
@rsanchezsaez

rsanchezsaez Jul 18, 2014

I'm experiencing this as well when trying to get previously stored items. They weird thing is that it seems to be happening semi-randomly.

In our case it seems related to trying to access the keychain in code inside a dispatch_once(&token, block).

I'm experiencing this as well when trying to get previously stored items. They weird thing is that it seems to be happening semi-randomly.

In our case it seems related to trying to access the keychain in code inside a dispatch_once(&token, block).

@soffes

This comment has been minimized.

Show comment
Hide comment
@soffes

soffes Jul 18, 2014

Owner

@rsanchezsaez hah! That'll do it :)

Owner

soffes commented Jul 18, 2014

@rsanchezsaez hah! That'll do it :)

@rsanchezsaez

This comment has been minimized.

Show comment
Hide comment
@rsanchezsaez

rsanchezsaez Jul 18, 2014

@soffes: How do you mean? That accessing the keychain inside a dispatch_once(&token, block) block produces this error? They weird thing is that we sometimes get it and sometimes don't (with the code being at the same exact place).

@soffes: How do you mean? That accessing the keychain inside a dispatch_once(&token, block) block produces this error? They weird thing is that we sometimes get it and sometimes don't (with the code being at the same exact place).

@soffes

This comment has been minimized.

Show comment
Hide comment
@soffes

soffes Jul 18, 2014

Owner

Oh, I thought you meant it was only happening sometimes because you were only executing the code once

Owner

soffes commented Jul 18, 2014

Oh, I thought you meant it was only happening sometimes because you were only executing the code once

@rsanchezsaez

This comment has been minimized.

Show comment
Hide comment
@rsanchezsaez

rsanchezsaez Jul 18, 2014

No, the code is ran once per application lifetime, but sometimes we get the bug and sometimes we don't (we have experienced the bug on several application runs, both in Debug and Release mode). :-)

No, the code is ran once per application lifetime, but sometimes we get the bug and sometimes we don't (we have experienced the bug on several application runs, both in Debug and Release mode). :-)

@ccwasden

This comment has been minimized.

Show comment
Hide comment
@ccwasden

ccwasden Oct 27, 2014

I am seeing -34018 "errSecDefault" on occasion, has anyone figured out what is going on or how to avoid it?

I am seeing -34018 "errSecDefault" on occasion, has anyone figured out what is going on or how to avoid it?

@mrkd

This comment has been minimized.

Show comment
Hide comment
@mrkd

mrkd Oct 27, 2014

I am also seeing the -34018 intermittently.

Error Domain=com.samsoffes.sskeychain Code=-34018 "errSecDefault" UserInfo=0x19fe8c10 {NSLocalizedDescription=errSecDefault}

mrkd commented Oct 27, 2014

I am also seeing the -34018 intermittently.

Error Domain=com.samsoffes.sskeychain Code=-34018 "errSecDefault" UserInfo=0x19fe8c10 {NSLocalizedDescription=errSecDefault}
@rvi

This comment has been minimized.

Show comment
Hide comment
@rvi

rvi Nov 3, 2014

Same here, on iOS 8.1 on iPhone 6. :/

rvi commented Nov 3, 2014

Same here, on iOS 8.1 on iPhone 6. :/

@ccwasden

This comment has been minimized.

Show comment
Hide comment
@ccwasden

ccwasden Nov 4, 2014

So, I was getting this error after accessing the Keychain around 100 times or so. Initially the keychain worked fine but then at some point it would just stop working and I couldn't access using sskeychain. Any chance it is connected to too many queries on the keychain in a short period of time?

ccwasden commented Nov 4, 2014

So, I was getting this error after accessing the Keychain around 100 times or so. Initially the keychain worked fine but then at some point it would just stop working and I couldn't access using sskeychain. Any chance it is connected to too many queries on the keychain in a short period of time?

@abc2mit

This comment has been minimized.

Show comment
Hide comment
@abc2mit

abc2mit Nov 4, 2014

I'm also getting this issue intermittently now on iPhone 5s, iOS 7.1.1.

It's weird.. I'm getting the error both on retrieve and save. It seems to be occurring on launch or re-launch of the app. I wonder if it's hitting the keychain too often?

abc2mit commented Nov 4, 2014

I'm also getting this issue intermittently now on iPhone 5s, iOS 7.1.1.

It's weird.. I'm getting the error both on retrieve and save. It seems to be occurring on launch or re-launch of the app. I wonder if it's hitting the keychain too often?

@abc2mit

This comment has been minimized.

Show comment
Hide comment
@abc2mit

abc2mit Nov 11, 2014

Does anyone know if the iOS Keychain is thread-safe? I'm actually hitting the iOS Keychain from multiple threads, usually in parallel, so I'm not sure if this is what is causing the -34018. I've also tried switching from kSecClassGenericPassword to kSecClassInternetPassword, but there doesn't seem to be an effect.

abc2mit commented Nov 11, 2014

Does anyone know if the iOS Keychain is thread-safe? I'm actually hitting the iOS Keychain from multiple threads, usually in parallel, so I'm not sure if this is what is causing the -34018. I've also tried switching from kSecClassGenericPassword to kSecClassInternetPassword, but there doesn't seem to be an effect.

@abc2mit

This comment has been minimized.

Show comment
Hide comment
@abc2mit

abc2mit Nov 17, 2014

@ccwasden That's an interesting thought. That might be true. Or a frequency issue, like 100 requests/hour. I still run into this once in a while, but I now built a cache around it. That's the only thing I can think of, since no one else seems to have any resolution.

abc2mit commented Nov 17, 2014

@ccwasden That's an interesting thought. That might be true. Or a frequency issue, like 100 requests/hour. I still run into this once in a while, but I now built a cache around it. That's the only thing I can think of, since no one else seems to have any resolution.

@chrisballinger

This comment has been minimized.

Show comment
Hide comment
@chrisballinger

chrisballinger Nov 20, 2014

We are seeing this randomly as well, haven't been able to figure it out yet. The most frustrating part is that sometimes quitting the app and running it again solves the problem. I've also only seen it when debugging and never in "release" builds so far.

We are seeing this randomly as well, haven't been able to figure it out yet. The most frustrating part is that sometimes quitting the app and running it again solves the problem. I've also only seen it when debugging and never in "release" builds so far.

@maqoo

This comment has been minimized.

Show comment
Hide comment
@maqoo

maqoo Nov 20, 2014

Hi - we use SSKeychain in our project right now and get this error a lot - debug only though.

Ussually it happens when updating code from git repo at first launch of debug version of the app (this one is actually fixable with the code signing script from http://stackoverflow.com/questions/20344255/secitemadd-and-secitemcopymatching-returns-error-code-34018-errsecmissingentit/22305193#22305193 )

Second thing is that when we use UIImagePicker to capture some photos. We try to access the keychain when UIImagePicker is visible and we can do it with no problem. But right after the image picker control is dismissed, this error starts to occur.

maqoo commented Nov 20, 2014

Hi - we use SSKeychain in our project right now and get this error a lot - debug only though.

Ussually it happens when updating code from git repo at first launch of debug version of the app (this one is actually fixable with the code signing script from http://stackoverflow.com/questions/20344255/secitemadd-and-secitemcopymatching-returns-error-code-34018-errsecmissingentit/22305193#22305193 )

Second thing is that when we use UIImagePicker to capture some photos. We try to access the keychain when UIImagePicker is visible and we can do it with no problem. But right after the image picker control is dismissed, this error starts to occur.

@abc2mit

This comment has been minimized.

Show comment
Hide comment
@abc2mit

abc2mit Nov 25, 2014

@chrisballinger @maqoo Thanks for the updates! I haven't yet incorporated downloading remote logs from my app yet, so I haven't see if there are any issues from release versions.

abc2mit commented Nov 25, 2014

@chrisballinger @maqoo Thanks for the updates! I haven't yet incorporated downloading remote logs from my app yet, so I haven't see if there are any issues from release versions.

@skingtree

This comment has been minimized.

Show comment
Hide comment
@skingtree

skingtree Dec 12, 2014

I also have this problem.
Some critical data not saved in keychain and retrieve nil when the app relaunch.
Just like something we trust not work in 100%.

I also have this problem.
Some critical data not saved in keychain and retrieve nil when the app relaunch.
Just like something we trust not work in 100%.

@soffes

This comment has been minimized.

Show comment
Hide comment
@soffes

soffes Dec 12, 2014

Owner

This is not an issue with SSKeychain. It is an issue with Keychain. Like the readme says:

Working with the keychain is pretty sucky. You should really check for errors and failures. This library doesn't make it any more stable, it just wraps up all of the annoying C APIs.

Good luck everyone.

Owner

soffes commented Dec 12, 2014

This is not an issue with SSKeychain. It is an issue with Keychain. Like the readme says:

Working with the keychain is pretty sucky. You should really check for errors and failures. This library doesn't make it any more stable, it just wraps up all of the annoying C APIs.

Good luck everyone.

@soffes soffes closed this Dec 12, 2014

@paulbruneau

This comment has been minimized.

Show comment
Hide comment
@paulbruneau

paulbruneau Jan 2, 2015

I'm glad to see I'm not the only one. When my app gets this, it basically "logs out" the user. I am going to have to re-think what I do when I see this.

I'm glad to see I'm not the only one. When my app gets this, it basically "logs out" the user. I am going to have to re-think what I do when I see this.

@nicklockwood nicklockwood referenced this issue in nicklockwood/FXKeychain Jan 13, 2015

Open

Error with iOS8 & XCode 6 #18

@diegopizzocaro

This comment has been minimized.

Show comment
Hide comment
@diegopizzocaro

diegopizzocaro Jan 21, 2015

Experiencing exactly the same and only in debug.
We debugged it a lot and it seems an issue accessing the keychain when the app is launched from the background. This is only happening with the debugger (i.e. when launched from Xcode).
We think the issue might be related in our case to the debugger keeping alive the app even if it should be killed by the OS.
We tried in fact to run the app and then put it in background and launch many other app to occupy RAM.
With the debugger the bug came up when resuming the app from the background, while without the debugger it didn't (we did run at least 10 tests each).

Note that if you're accessing the keychain in the background you should have something like this in your didFinishLaunchingWithOption

[SSKeychain setAccessibilityType:kSecAttrAccessibleAfterFirstUnlock];

Experiencing exactly the same and only in debug.
We debugged it a lot and it seems an issue accessing the keychain when the app is launched from the background. This is only happening with the debugger (i.e. when launched from Xcode).
We think the issue might be related in our case to the debugger keeping alive the app even if it should be killed by the OS.
We tried in fact to run the app and then put it in background and launch many other app to occupy RAM.
With the debugger the bug came up when resuming the app from the background, while without the debugger it didn't (we did run at least 10 tests each).

Note that if you're accessing the keychain in the background you should have something like this in your didFinishLaunchingWithOption

[SSKeychain setAccessibilityType:kSecAttrAccessibleAfterFirstUnlock];

@zinthemoney zinthemoney referenced this issue in venmo/VENTouchLock Jan 30, 2015

Closed

Random False Positive #34

@tspecht

This comment has been minimized.

Show comment
Hide comment
@tspecht

tspecht Mar 19, 2015

Has anyone ever figured this one out?

tspecht commented Mar 19, 2015

Has anyone ever figured this one out?

@paulbruneau

This comment has been minimized.

Show comment
Hide comment
@paulbruneau

paulbruneau Mar 19, 2015

I figured out don't use keychain except as a backup for if they uninstall your app.

I figured out don't use keychain except as a backup for if they uninstall your app.

@cipherCOM

This comment has been minimized.

Show comment
Hide comment
@cipherCOM

cipherCOM Mar 26, 2015

After seeing soffes#52 (comment) from diegopizzocaro we could solve this.

We used the keychain to store Facebook tokens in a special way (so the main and WatchKit app could access it / enabled keychain access groups). Most of the time the error arose after allowing the application from within Safari which causes a application change to finish the login flow.
Coming from the background we had to store token but the [[UIApplication sharedApplication] applicationState] was still UIApplicationStateInactive. This caused the famous -34018 error for us.

After placing the mentioned kSecAttrAccessibleAfterFirstUnlock setting the error was gone.

After seeing soffes#52 (comment) from diegopizzocaro we could solve this.

We used the keychain to store Facebook tokens in a special way (so the main and WatchKit app could access it / enabled keychain access groups). Most of the time the error arose after allowing the application from within Safari which causes a application change to finish the login flow.
Coming from the background we had to store token but the [[UIApplication sharedApplication] applicationState] was still UIApplicationStateInactive. This caused the famous -34018 error for us.

After placing the mentioned kSecAttrAccessibleAfterFirstUnlock setting the error was gone.

@elviin

This comment has been minimized.

Show comment
Hide comment
@elviin

elviin Apr 17, 2015

@cipherCOM FXKeyChain uses kSecAttrAccessibleAfterFirstUnlock and still has the same issue.

elviin commented Apr 17, 2015

@cipherCOM FXKeyChain uses kSecAttrAccessibleAfterFirstUnlock and still has the same issue.

@benguild

This comment has been minimized.

Show comment
Hide comment
@benguild

benguild May 17, 2015

I'm using "kSecAttrAccessibleAfterFirstUnlock" and noticed that if I have the Control Center screen slid-up over the app (UIApplicationStateInactive?) I sometimes start getting "Keychain error: errSecDefault" and it breaks the app until it's restarted.

Moving to a strategy of storing the keys in memory locally instead of just fetching them from the Keychain every time, but man... this is kind of annoying. Is there any real workaround? This is on iOS 8.3 release.

I'm using "kSecAttrAccessibleAfterFirstUnlock" and noticed that if I have the Control Center screen slid-up over the app (UIApplicationStateInactive?) I sometimes start getting "Keychain error: errSecDefault" and it breaks the app until it's restarted.

Moving to a strategy of storing the keys in memory locally instead of just fetching them from the Keychain every time, but man... this is kind of annoying. Is there any real workaround? This is on iOS 8.3 release.

@elviin

This comment has been minimized.

Show comment
Hide comment
@elviin

elviin May 17, 2015

I have received an email from the Apple support stating that: "Our engineers have reviewed your request and have determined that you are experiencing an issue for which there is no known workaround at this time."

elviin commented May 17, 2015

I have received an email from the Apple support stating that: "Our engineers have reviewed your request and have determined that you are experiencing an issue for which there is no known workaround at this time."

@benguild

This comment has been minimized.

Show comment
Hide comment
@benguild

benguild May 17, 2015

That sucks. I think I can maybe shift this app over to NSURLCredential instead, so I'm going to try that. Has anyone run into this issue with that class?

That sucks. I think I can maybe shift this app over to NSURLCredential instead, so I'm going to try that. Has anyone run into this issue with that class?

@paulbruneau

This comment has been minimized.

Show comment
Hide comment
@paulbruneau

paulbruneau May 17, 2015

Great discovery about the control center. I switched to using NSUserDefaults as my primary storage (my data is not very sensitive).

Great discovery about the control center. I switched to using NSUserDefaults as my primary storage (my data is not very sensitive).

@mteece

This comment has been minimized.

Show comment
Hide comment
@mteece

mteece Dec 18, 2015

UICKeyChain suffers from the same issue. We're seeing the same problem with it. Really stems from Keychain. We were hoping iOS 9.2 would resolve it, but no such luck https://forums.developer.apple.com/thread/4743.

mteece commented Dec 18, 2015

UICKeyChain suffers from the same issue. We're seeing the same problem with it. Really stems from Keychain. We were hoping iOS 9.2 would resolve it, but no such luck https://forums.developer.apple.com/thread/4743.

@Valpertui

This comment has been minimized.

Show comment
Hide comment
@Valpertui

Valpertui Dec 21, 2015

Neither 9.2.1

Neither 9.2.1

@ntnmrndn

This comment has been minimized.

Show comment
Hide comment
@ntnmrndn

ntnmrndn Dec 23, 2015

Same issue here :(

Same issue here :(

@devValley

This comment has been minimized.

Show comment
Hide comment
@devValley

devValley Feb 8, 2016

Still happens on iOS 9.2, iPhone 6s.

Still happens on iOS 9.2, iPhone 6s.

@ryanphillipthomas ryanphillipthomas referenced this issue in braintree/braintree_ios Feb 18, 2016

Closed

Drop-In UI crashes on iOS 9.x #219

@davebang

This comment has been minimized.

Show comment
Hide comment
@davebang

davebang Mar 3, 2016

Still happens - iPhone 6+, iOS 9.2.1

davebang commented Mar 3, 2016

Still happens - iPhone 6+, iOS 9.2.1

@xinGGG

This comment has been minimized.

Show comment
Hide comment
@xinGGG

xinGGG Mar 8, 2016

Still happens - iPhone 6+, iOS 9.2.1

xinGGG commented Mar 8, 2016

Still happens - iPhone 6+, iOS 9.2.1

@animaonline

This comment has been minimized.

Show comment
Hide comment

Following

@lmastashimi

This comment has been minimized.

Show comment
Hide comment

Following

@effzehn

This comment has been minimized.

Show comment
Hide comment

effzehn commented Mar 21, 2016

@liujianan901228

This comment has been minimized.

Show comment
Hide comment

Following

@samjarman

This comment has been minimized.

Show comment
Hide comment
@samjarman

samjarman Apr 10, 2016

Glad I'm not alone, sad this is an issue.

Glad I'm not alone, sad this is an issue.

@xinGGG

This comment has been minimized.

Show comment
Hide comment
@xinGGG

xinGGG Apr 10, 2016

I found that this was a problem when I repeated the use of the key in the same period.

xinGGG commented Apr 10, 2016

I found that this was a problem when I repeated the use of the key in the same period.

@samjarman

This comment has been minimized.

Show comment
Hide comment
@samjarman

samjarman Apr 10, 2016

@xinGGG Can you please explain further?

@xinGGG Can you please explain further?

@samjarman

This comment has been minimized.

Show comment
Hide comment
@samjarman

samjarman Apr 10, 2016

I tried to distribute the app I was working on via TestFlight and found the same issue. Grr.

I tried to distribute the app I was working on via TestFlight and found the same issue. Grr.

@jeremangnr jeremangnr referenced this issue in jeremangnr/JNKeychain Apr 22, 2016

Closed

Keychain error -34018 #11

@mAu888

This comment has been minimized.

Show comment
Hide comment
@mAu888

mAu888 Apr 28, 2016

Contributor

[...] We believe these problems were resolved in iOS 9.3. [...]
https://forums.developer.apple.com/thread/4743#126088

Contributor

mAu888 commented Apr 28, 2016

[...] We believe these problems were resolved in iOS 9.3. [...]
https://forums.developer.apple.com/thread/4743#126088

@paulbruneau

This comment has been minimized.

Show comment
Hide comment
@paulbruneau

paulbruneau May 2, 2016

We suspect that there may be yet more causes of this problem.

We suspect that there may be yet more causes of this problem.

@benguild

This comment has been minimized.

Show comment
Hide comment
@benguild

benguild Jul 8, 2016

Anybody know if this is fixed in iOS 10?

benguild commented Jul 8, 2016

Anybody know if this is fixed in iOS 10?

@benguild

This comment has been minimized.

Show comment
Hide comment
@benguild

benguild Jul 8, 2016

@danielgalasko Can you post a Gist that shows how to correctly throw the exception if it encounters this error?

benguild commented Jul 8, 2016

@danielgalasko Can you post a Gist that shows how to correctly throw the exception if it encounters this error?

@SamuraiZack

This comment has been minimized.

Show comment
Hide comment
@SamuraiZack

SamuraiZack Aug 5, 2016

Following as well

Following as well

@XiMouQiu

This comment has been minimized.

Show comment
Hide comment
@XiMouQiu

XiMouQiu Aug 16, 2016

I have same problem about this issue

I have same problem about this issue

@lagapollo

This comment has been minimized.

Show comment
Hide comment
@lagapollo

lagapollo Aug 24, 2016

got a workaround by enabling keychain sharing in app capabilities

lagapollo commented Aug 24, 2016

got a workaround by enabling keychain sharing in app capabilities

@benguild

This comment has been minimized.

Show comment
Hide comment
@benguild

benguild Aug 24, 2016

@lagapollo Are you sure that actually works?

@lagapollo Are you sure that actually works?

@briananderson1222

This comment has been minimized.

Show comment
Hide comment
@briananderson1222

briananderson1222 Aug 24, 2016

My app had been working on iOS8 and iOS9, but stopped working with iOS 10. Using the 'fix' provided by @lagapollo works but seems unnecessary.. is this a bug?

My app had been working on iOS8 and iOS9, but stopped working with iOS 10. Using the 'fix' provided by @lagapollo works but seems unnecessary.. is this a bug?

@samjarman

This comment has been minimized.

Show comment
Hide comment
@briankoksal

This comment has been minimized.

Show comment
Hide comment
@briankoksal

briankoksal Aug 27, 2016

workaround from @lagapollo worked for me in iOS10

briankoksal commented Aug 27, 2016

workaround from @lagapollo worked for me in iOS10

@akbortoli

This comment has been minimized.

Show comment
Hide comment
@akbortoli

akbortoli Sep 15, 2016

Make sure you enable keychain sharing in the capabilities screen.

not working on iOS 10 #149

keychain-sharing

Make sure you enable keychain sharing in the capabilities screen.

not working on iOS 10 #149

keychain-sharing

@samjarman

This comment has been minimized.

Show comment
Hide comment
@samjarman

samjarman Sep 15, 2016

Except there are no capabilities for test targets, so if you're trying to write to the keychain in a unit test/test target... you'll get this issue too. Any ideas for fixing that?

Except there are no capabilities for test targets, so if you're trying to write to the keychain in a unit test/test target... you'll get this issue too. Any ideas for fixing that?

@phatmann

This comment has been minimized.

Show comment
Hide comment
@phatmann

phatmann Sep 19, 2016

As long as there is an Entitlements file, the simulator will work correctly. You do not need to enable Keychain Sharing (but toggling it on and off creates the entitlements file).

As long as there is an Entitlements file, the simulator will work correctly. You do not need to enable Keychain Sharing (but toggling it on and off creates the entitlements file).

@xilin

This comment has been minimized.

Show comment
Hide comment
@xilin

xilin Sep 20, 2016

So that explain why my app works well without enabling Keychain Sharing.

2016-09-20 3:36 GMT+08:00 phatmann notifications@github.com:

As long as there is an Entitlements file, the simulator will work
correctly. You do not need to enable Keychain Sharing (but toggling it on
and off creates the entitlements file).


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#52 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAhKo4zTakdCa8yL-yIm2Pa9NJ7gY9_pks5qruQlgaJpZM4BRXw1
.

xilin commented Sep 20, 2016

So that explain why my app works well without enabling Keychain Sharing.

2016-09-20 3:36 GMT+08:00 phatmann notifications@github.com:

As long as there is an Entitlements file, the simulator will work
correctly. You do not need to enable Keychain Sharing (but toggling it on
and off creates the entitlements file).


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#52 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAhKo4zTakdCa8yL-yIm2Pa9NJ7gY9_pks5qruQlgaJpZM4BRXw1
.

@mistdon

This comment has been minimized.

Show comment
Hide comment
@mistdon

mistdon Oct 17, 2016

Following....

mistdon commented Oct 17, 2016

Following....

@sasikiran

This comment has been minimized.

Show comment
Hide comment
@sasikiran

sasikiran Oct 25, 2016

From the Xcode 8.1 GM release notes, this is mentioned under Known Issues

Keychain APIs may fail to work in the Simulator if your entitlements file doesn’t contain a value for the application-identifier entitlement. (28338972)
Workaround: Add a user-defined build setting to your target named ENTITLEMENTS_REQUIRED and set the value to YES. This will cause Xcode to automatically insert an application-identifier entitlement when building.

From the Xcode 8.1 GM release notes, this is mentioned under Known Issues

Keychain APIs may fail to work in the Simulator if your entitlements file doesn’t contain a value for the application-identifier entitlement. (28338972)
Workaround: Add a user-defined build setting to your target named ENTITLEMENTS_REQUIRED and set the value to YES. This will cause Xcode to automatically insert an application-identifier entitlement when building.

@timbroder

This comment has been minimized.

Show comment
Hide comment
@timbroder

timbroder Nov 28, 2016

following...

following...

@shaneowens

This comment has been minimized.

Show comment
Hide comment

Following

@lyndsey-ferguson lyndsey-ferguson referenced this issue in fastlane/fastlane Jan 10, 2017

Merged

Add support to copy simulator device logs to output directory #7804

4 of 4 tasks complete
@hryamzik

This comment has been minimized.

Show comment
Hide comment
@hryamzik

hryamzik Jan 20, 2017

Getting the same on Mac OS but not sure if I'm doing it right.

        SAMKeychainQuery *q = [SAMKeychainQuery new];
        q.synchronizationMode = SAMKeychainQuerySynchronizationModeYes;
        q.service = @"myService";
        q.account = @"myAccount";
        q.password = @"pass";
        NSError* error = nil;
        [q save:&error];
        if (error != nil) {
            NSLog(@"Err: %@", [error localizedDescription]);
        }

Getting the same on Mac OS but not sure if I'm doing it right.

        SAMKeychainQuery *q = [SAMKeychainQuery new];
        q.synchronizationMode = SAMKeychainQuerySynchronizationModeYes;
        q.service = @"myService";
        q.account = @"myAccount";
        q.password = @"pass";
        NSError* error = nil;
        [q save:&error];
        if (error != nil) {
            NSLog(@"Err: %@", [error localizedDescription]);
        }

@lkraider lkraider referenced this issue in psequel/psequel May 12, 2017

Open

Crash when connecting #106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment