kishikawakatsumi / KeychainAccess

Simple Swift wrapper for Keychain that works on iOS, watchOS, tvOS and macOS.
MIT License
7.95k stars 788 forks source link

The specified item already exists in the keychain. #443

Open Saulenco opened 5 years ago

Saulenco commented 5 years ago

On iPad 4 (iOS 10.3.3) when i'm trying to update a value i'm getting this exception: The specified item already exists in the keychain.

this is how i use it:

 let keychain = Keychain(service: key).accessibility(.afterFirstUnlock)
 do { 
       try keychain.set(value, key: MyKey)
        } catch let error {
            print(error.localizedDescription)
        }
snoozemoose commented 5 years ago

I just ran into the very same issue, it only happened once at app boot/session start and then never again. Does anybody know what could be the cause and how to avoid it in the future? For now I've added a removal of the items before trying to set them again to avoid this issue in the future but I'm not sure if this is a good idea or not. Anybody here who could share some light on the best practices for when the keychain can't be written to?

EthanLipnik commented 3 years ago

Any update on this?

nodediggity commented 8 months ago

I'm seeing this issue running under iOS 17.4.

CyonAlexRDX commented 2 months ago

This merged PR into Flutter Secure Storage repo, merged earlier this summer, seems interesting:

https://github.com/mogol/flutter_secure_storage/pull/751