Swift Sdtlib tool error: Task failed with exit code 1
Solution 1
I use macOS High Sierra, Xcode 9.3: This worked for me.
- Go to
/Users/JohnAppleseed/Library/Developer/Xcode/DerivedData/
- Moved all the files to Trash, empty the trash
- Opened Xcode, Clean and Build.
Restarting xcode or macbook, dragging and dropping certificate in the keychain did not work for me.
Solution 2
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:
- Close Xcode.
- Open Key Chain.
- Find the iOS Developer cert in Local.
- Drag and drop the cert from Local to the System tab.
- Enter admin password when prompted.
- Start Xcode and build project for your device.
Solution 3
I had the same problem - I resolved it by restarting my MacBook several times.
Solution 4
In my case, it was solved by
- Close Xcode.
- Clean Derived data.
- Open Xcode.
- Clean Product.
- Run your app.
Solution 5
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:
- Close Xcode.
- Open Key Chain.
- Find the iOS Developer cert in Local.
- Drag and drop the cert from Local to the System tab.
- Enter admin password when prompted.
- Start Xcode and build project for your device.
Related videos on Youtube
kingfoot
Updated on June 17, 2020Comments
-
kingfoot almost 4 years
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.
-
mikeT over 6 yearsAll other solutions didn't work Easiest solution is to use freemacsoft.net/appcleaner App cleaner, remove Xcode completely with it's resources and preferences (it'll take a while). And re-install Xcode. The issue happened when Xcode pop-up asking for password (when using simulator), I kept putting it in, and it kept asking for it over and over. So I clicked declined. When running the Xcode simulator for the first time, make sure you type the password & click Always Allow (Not sure of the wording), it will prompt you 3-4 times. After that it was Perfect.
-
-
James Toomey over 6 yearsThis totally worked, so thank you, but how in the world did you figure it out? In my case it was in the login keychain, so when I dragged it to the System keychain, it actually copied it over, not moved it.
-
Alexander over 6 years
your certificicate
what certificate? -
kingfoot over 6 years@JamesToomey Honestly? I don't remember at all. But I do know that in the future if this happens, I know where to look. Hopefully this thread can help people find where to look too. I wish I had more explanation to give, so as to provide a greater understanding, but I don't fully understand it myself haha.
-
Luke Eckley over 6 yearsWhen I got to step 4 here Keychain said the Cert was invalid. I just deleted the iOS Developer key and created it again in Xcode. Worked fine after that.
-
rgkobashi about 6 yearsThe certificate that your provisioning profile uses no sign your app. This whole provisioning/certificate thing can be a little tricky, you can read this article which explains how the whole thing works. In my case was the distribution certificate (iPhone Distribution: XXXXX)
-
rgkobashi about 6 yearsThanks! It worked for me too. However I am curious why doing this will fix that, and I think it works because the keys stored on
System
keychain the access control is set to "Allow all applications to access this item" by default, and onLogin
keychain you need to specify what apps. -
Roozbeh Zabihollahi about 6 yearsRestarting my Mac fixed the problem :-)
-
Brian Bird about 6 yearsI tried clean, restarting Xcode did not work for me. I finally had to restart my Mac book pro running High Sierra and this resolved my issue.
-
kingfoot almost 6 yearsThanks for the update! This was done on my El Capitan MacBook Pro in 2016 so it doesn't surprise me things might have changed. I've selected this as an answer as well.
-
Jeremy Andrews almost 6 yearsAfter trying all the other solutions this worked for me but with the difference - I only deleted files in DerivedData which had been currently used. I further removed all out-of-date certificates in KeyChain.
-
Søren Pedersen over 5 yearsDoesn't work for me, and I don't see any reason why it should either. The Apple dev community need to stop suggesting to delete derriveddata every time Xcode misbehaves.
-
Rolf Beh over 5 yearsOh damn - I cannot believe this. Restarting the machine fixed it for me as well. I am not sure, if I am on Windows or MacOS right now ;-)
-
Daniel Mavrakis over 5 yearsThis worked for me, but I had the restart the macbook after deleting derived data to make it work.
-
Jeremy Andrews over 5 yearsI don't recall how many times probably 2 or 3 times however I am not convinced that the restart alone did the trick I probably used the disk utility first aid and possibly a recovery restart and disk first aid as well.
-
Pengson over 4 yearsWorks for me. Save my day. Thanks a lot.
-
Leap Hawk over 3 yearsYou can do it the same if facing in case of MacOS Development Certificate.