xcode Swift Sdtlib 工具错误:任务失败,退出代码为 1

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41205250/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 18:24:22  来源:igfitidea点击:

Swift Sdtlib tool error: Task failed with exit code 1

xcode

提问by kingfoot

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.

今天早上在我的应用程序上随机工作了几个小时后,Xcode 只是停止让我在我的 iPhone 上测试我的应用程序。但是我仍然可以在模拟器中测试它。

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.

我在 macOS Sierra 10.12.12 上运行 Xcode 8.2,在装有 iOS 10.1.1 的 iPhone 6s 上进行测试。

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

注意:从我的机器上完全删除 Xcode 后,我重新安装了它,并删除并重新创建了所有硬件的所有配置文件。

采纳答案by Cons Bulaquena

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

我使用 macOS High Sierra,Xcode 9.3:这对我有用。

  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.
  1. /Users/JohnAppleseed/Library/Developer/Xcode/DerivedData/
  2. 将所有文件移至废纸篓,清空废纸篓
  3. 打开Xcode,清理并构建。

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

重新启动 xcode 或 macbook,在钥匙串中拖放证书对我不起作用。

回答by kingfoot

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.

使用 Key Chain 将我的 iOS 开发人员证书从本地移动到系统。

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.
  1. 关闭 Xcode。
  2. 打开钥匙链。
  3. 在本地找到 iOS 开发者证书。
  4. 将证书从本地拖放到系统选项卡。
  5. 出现提示时输入管理员密码。
  6. 启动 Xcode 并为您的设备构建项目。

回答by Jeremy Andrews

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

我遇到了同样的问题 - 我通过多次重新启动我的 MacBook 来解​​决它。

回答by Ramakrishna

In my case, it was solved by

就我而言,它已通过

  1. Close Xcode.
  2. Clean Derived data.
  3. Open Xcode.
  4. Clean Product.
  5. Run your app.
  1. 关闭 Xcode。
  2. 清洁派生数据。
  3. 打开 Xcode。
  4. 清洁产品。
  5. 运行您的应用程序。

回答by Gibraltar

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

首先确保您的证书没有过期,然后按照kingfoot列出的步骤操作:

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

使用 Key Chain 将 iOS 开发者证书从本地移动到系统:

  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.
  1. 关闭 Xcode。
  2. 打开钥匙链。
  3. 在本地找到 iOS 开发者证书。
  4. 将证书从本地拖放到系统选项卡。
  5. 出现提示时输入管理员密码。
  6. 启动 Xcode 并为您的设备构建项目。

回答by JustApps

What I did to solve it was:

我为解决它所做的是:

  1. Quit Xcode

  2. Open Keychain Access

  3. Go to Login tab

  4. Drag your certificate into System tab

  5. Reopen Xcode

  6. Run your app

  1. 退出 Xcode

  2. 打开钥匙串访问

  3. 转到登录选项卡

  4. 将您的证书拖入系统选项卡

  5. 重新打开Xcode

  6. 运行你的应用