Search code examples
iosswiftxcodefluttercodesign

Swift stdlib tool error - the specified item could not be found in keychain


I have a flutter application that used Objective-C as a base, then I've added some libs that are SWIFT based, so I switched the SWIFT support on, and from it, all the troubles began. I've added a SWIFT support:

config.build_settings['SWIFT_VERSION'] = '5.0'

use_frameworks!

and

platform :ios, '9.0'

to my Podfile. This actions removed all swift-lib related errors, but now I receive the error above about the codesigning.

I've read the information about this error and tried the following:

  1. Resetting the login keychain
  2. Entering the login keychain password in a prompt with "Always allow"
  3. Deleting Derived data
  4. Reinstalling Xcode
  5. Restarting macOS a million times
  6. Moving a developer cert to the System keychain
  7. Creating a completely new Apple ID and all certificates

Nothing helped, the error is this here and is the same.

Developer/Xcode/DerivedData/Runner-bwqlfsixhrzgsfakfinzgchwtvci/Build/Products/Debug-iphoneos/Runner.app/Frameworks/libswiftCoreLocation.dylib'
error: The specified item could not be found in the keychain.

Probing signature of /Users/alutikova/Library/Developer/Xcode/DerivedData/Runner-bwqlfsixhrzgsfakfinzgchwtvci/Build/Products/Debug-iphoneos/Runner.app/Frameworks/libswiftDispatch.dylib
error: The specified item could not be found in the keychain.
Probing signature of /Users/alutikova/Library/Developer/Xcode/DerivedData/Runner-bwqlfsixhrzgsfakfinzgchwtvci/Build/Products/Debug-iphoneos/Runner.app/Frameworks/libswiftMetal.dylib
error: The specified item could not be found in the keychain.

Probing signature of /Users/alutikova/Library/Developer/Xcode/DerivedData/Runner-bwqlfsixhrzgsfakfinzgchwtvci/Build/Products/Debug-iphoneos/Runner.app/Frameworks/libswiftQuartzCore.dylib
  /usr/bin/codesign '-r-' '--display' '/Users/alutikova/Library/Developer/Xcode/DerivedData/Runner-bwqlfsixhrzgsfakfinzgchwtvci/Build/Products/Debug-iphoneos/Runner.app/Frameworks/libswiftQuartzCore.dylib'
error: The specified item could not be found in the keychain.

Any help would be greatly appreciated, since I'm completely stuck.


Solution

  • Okay, the only solution that helped is the one described in this thread: https://forums.developer.apple.com/message/325197#325197

    And the problem was that I have an active USB token inserted in the USB port as I need a VPN connection to be active on my machine. If i remove it, codesigning works correctly. The link above gives a workaround if u can't remove the USB token or a smart card token.

    Hope that helps someone!