matthewpalmer / Locksmith

A powerful, protocol-oriented library for working with the keychain in Swift.
MIT License
2.92k stars 268 forks source link

Trouble Loading Keychain Data Xcode 10.2 Swift 4 #207

Open MayankAgarwal04 opened 5 years ago

MayankAgarwal04 commented 5 years ago

Hi Team,

I am having a trouble loading the keychain data. App crash when loadDataForUserAccount is called. Mac OS 10.14.4 and Xcode 10.2 Swift 4

I updated my Mac os to 10.14.4 and updated my Xcode to 10.2 & project swift version 4 to convert 5. After that when first time Xcode Run project login successfully after second time Xcode project Run app crash I tried to error "expression produced error: error: /var/folders/s1/: error: no type named 'ReadRequest' in module Swift._DebuggerSupport.stringForPrintObject(Swift.UnsafePointer(bitPattern: 0x13e1e2890)!.pointee)".

Let me know if I'm doing anything wrong from my side. Is there any particular reason for that?

Error Function :-

public static func loadDataForUserAccount(userAccount: String, inService service: String = LocksmithDefaultService) -> [String: Any]? { struct ReadRequest: GenericPasswordSecureStorable, ReadableSecureStorable { let service: String let account: String }

    let request = ReadRequest(service: service, account: userAccount)
    **return request.readFromSecureStore()?.data**
}

Error Message :-

expression produced error: error: /var/folders/s1/: error: no type named 'ReadRequest' in module '' Swift._DebuggerSupport.stringForPrintObject(Swift.UnsafePointer(bitPattern: 0x13e1e2890)!.pointee)

@matthewpalmer @victor @jonallured @hermanolsson @jakemarsh @diejmon @marcelofabri @edwellbrook @larslockefeer

romkoth commented 5 years ago

Hi all, I have the same issue, Xcode 10.2 and iOS simulator 12.2 Tried to erase all content and settings, haven;t helped

LaurentShala commented 5 years ago

Getting same error as well. Definitely a problem when using this Pod on Xcode 10.2.

albertbori commented 5 years ago

Still an issue. At the line specified by the OP, my crash report says:

Exception Type:  SIGSEGV
Exception Codes: SEGV_ACCERR at 0x9a0f3b28

Edit: I removed the Locksmith cocoapod completely. Then, I copied the Source files from Locksmith into my main project, and the error went away. So this error likely has something to do with cocoapods or project configuration.

felipeplets commented 5 years ago

I had the same issue before and did the following steps:

  1. Updated CocoaPods to 1.7.0 RC1
  2. Followed again the setup steps for Keychain Sharing:
    1. Choose your target project
    2. Select Capabilities
    3. Enable Keychain Sharing

It solved my case