Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift Sdtlib tool error: Task failed with exit code 1

Tags:

xcode

So randomly after several hours of work this morning on my app, Xcode just stopped letting me test my app on my iPhone. But I can still test it in the simulator.

Now, when I build a project (note: ANY project, even blank single view project that was just created), I get the following error;

Codesigning /Users/name/Library/Developer/Xcode/DerivedData/testProject-brzcahttttlkoqeczajhqslodkkn/Build/Products/Debug-iphoneos/testProject.app/Frameworks/libswiftCore.dylib /usr/bin/codesign '--force' '--sign' '64F8B22715267CC0910110D9C97A2567591C0235' '--verbose' '/Users/name/Library/Developer/Xcode/DerivedData/testProject-brzcahttttlkoqeczajhqslodkkn/Build/Products/Debug-iphoneos/testProject.app/Frameworks/libswiftCore.dylib' 

SecKey API returned: -25304, (null)/Users/name/Library/Developer/Xcode/DerivedData/testProject-brzcahttttlkoqeczajhqslodkkn/Build/Products/Debug-iphoneos/testProject.app/Frameworks/libswiftCore.dylib: unknown error -1=ffffffffffffffff error: Task failed with exit 1 signal 0 {    /usr/bin/codesign '--force' '--sign' '64F8B22715267CC0910110D9C97A2567591C0235' '--verbose' '/Users/name/Library/Developer/Xcode/DerivedData/testProject-brzcahttttlkoqeczajhqslodkkn/Build/Products/Debug-iphoneos/testProject.app/Frameworks/libswiftCore.dylib'

I'm running Xcode 8.2 on macOS Sierra 10.12.12, testing on an iPhone 6s with iOS 10.1.1.

Note: I have reinstalled Xcode after fully removing it from my machine, as well deleting and recreating all my provisioning profiles for all hardware.

like image 544
kingfoot Avatar asked Dec 18 '16 03:12

kingfoot


5 Answers

Ok so I solved this, don't know if it's the right way or not.

Moved my iOS developer certificate from local to system using Key Chain.

Steps:

  1. Close Xcode.
  2. Open Key Chain.
  3. Find the iOS Developer cert in Local.
  4. Drag and drop the cert from Local to the System tab.
  5. Enter admin password when prompted.
  6. Start Xcode and build project for your device.
like image 178
kingfoot Avatar answered Nov 03 '22 19:11

kingfoot


I use macOS High Sierra, Xcode 9.3: This worked for me.

  1. Go to /Users/JohnAppleseed/Library/Developer/Xcode/DerivedData/
  2. Moved all the files to Trash, empty the trash
  3. Opened Xcode, Clean and Build.

Restarting xcode or macbook, dragging and dropping certificate in the keychain did not work for me.

like image 25
Cons Bulaquena Avatar answered Nov 03 '22 18:11

Cons Bulaquena


I had the same problem - I resolved it by restarting my MacBook several times.

like image 35
Jeremy Andrews Avatar answered Nov 03 '22 19:11

Jeremy Andrews


In my case, it was solved by

  1. Close Xcode.
  2. Clean Derived data.
  3. Open Xcode.
  4. Clean Product.
  5. Run your app.
like image 3
Ramakrishna Avatar answered Nov 03 '22 20:11

Ramakrishna


First make sure your certificates haven't expired and then follow the steps listed by king foot:

Move the iOS developer certificate from local to system using Key Chain:

  1. Close Xcode.
  2. Open Key Chain.
  3. Find the iOS Developer cert in Local.
  4. Drag and drop the cert from Local to the System tab.
  5. Enter admin password when prompted.
  6. Start Xcode and build project for your device.
like image 1
Gibraltar Avatar answered Nov 03 '22 19:11

Gibraltar