升级到 Xcode 8 后设备构建失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39932620/
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
Device build fails after upgrading to Xcode 8
提问by Jacob Reshef
Since upgrading to Xcode 8 I cannot run any app on my iPhone. The build fails with error:
升级到 Xcode 8 后,我无法在 iPhone 上运行任何应用程序。构建失败并出现错误:
error: Task failed with exit 0 signal 11
错误:任务失败,退出 0 信号 11
I can run the apps on the simulators, just not on a device. The full error message:
我可以在模拟器上运行应用程序,但不能在设备上运行。完整的错误信息:
error: Task failed with exit 0 signal 11 { /usr/bin/codesign '--force' '--sign' '7F49C2A625C8976762BDEA351F8DA88E4F6FED22' '--verbose' '/Users/reshef/Library/Developer/Xcode/DerivedData/testXcode-eltpwhxdshmmlygolxcnsroevmoo/Build/Products/Debug-iphoneos/testXcode.app/Frameworks/libswiftCore.dylib' }
错误:任务失败,退出 0 信号 11 { /usr/bin/codesign '--force' '--sign' '7F49C2A625C8976762BDEA351F8DA88E4F6FED22' '--verbose' '/Users/reshef/Library/DeveloperData/TestD eltpwhxdshmmlygolxcnsroevmoo/Build/Products/Debug-iphoneos/testXcode.app/Frameworks/libswiftCore.dylib' }
回答by Damn Vegetables
Damn Xcode...
该死的Xcode...
After upgrading to High Sierra and Xcode 9, I have spend a lot of time... After combining all the answers here, I solved it in the following way.
升级到High Sierra和Xcode 9后,我花了很多时间......结合这里的所有答案后,我通过以下方式解决了它。
- Delete the derived data as others said.
- Clean the project as others said.
- Restart the OS <-- This was the key. Only after a reboot it showed the password popup.
- When the popup shows that says xcode wants password to something, type your login password, and DO NOT PRESS ALLOW, but PRESS ALWAYS ALLOW. <- Important!
- 删除其他人所说的派生数据。
- 像其他人所说的那样清理项目。
- 重新启动操作系统 <-- 这是关键。只有在重新启动后才显示密码弹出窗口。
- 当弹出窗口显示 xcode 需要密码时,请输入您的登录密码,并不要按允许,但按始终允许。<- 重要!
回答by Yahoho
Use automatically manage signing:
使用自动管理签名:
Go to Target --> General --> Signing, check the Automatically manage siging.
转到目标 --> 常规 --> 签名,选中自动管理签名。
回答by Phil
cd /Users/xxx/Library/Developer/Xcode/DerivedData
cd /Users/xxx/Library/Developer/Xcode/DerivedData
clean ~
干净~
回答by Bulent Keles
Had the exact same issue. First cleaned the Product then restarted the computer. Worked for me!
有完全相同的问题。首先清洁产品,然后重新启动计算机。对我来说有效!
回答by Chuck Wolber
I found that by deleting my account under preferences and re-adding it, I can usually solve this problem.
我发现通过在首选项下删除我的帐户并重新添加它,我通常可以解决这个问题。
- Click the Xcode menu and select Preferences...
- Select the Accounts tab.
- Select your developer account under "Apple IDs"
- Click the "-" button at the bottom to remove it.
- Add your developer account back with the "+" button.
- 单击 Xcode 菜单并选择 Preferences...
- 选择帐户选项卡。
- 在“Apple ID”下选择您的开发者帐户
- 单击底部的“-”按钮将其删除。
- 使用“+”按钮重新添加您的开发者帐户。
回答by Ramakrishna
In my case,
就我而言,
- Close Xcode.
- Clean Derived data.
- Open Xcode.
- Clean Product.
- Run your app.
- 关闭 Xcode。
- 清洁派生数据。
- 打开 Xcode。
- 清洁产品。
- 运行您的应用程序。
回答by Martin
For me this issue was due to expired certificate. I updated my certificate and provisioning profileand issue got solved.
对我来说,这个问题是由于证书过期。我更新了我的证书和配置文件,问题得到了解决。
回答by Yourange
If you still face this issue and you have upgraded to MacOS Sierra. You can look in the keychain and delete a system key named "1". This solved my problem "Task failed with exit 0 signal 5"
如果您仍然遇到此问题并且您已升级到 MacOS Sierra。您可以查看钥匙串并删除名为“1”的系统密钥。这解决了我的问题“任务失败,退出 0 信号 5”
回答by TheValyreanGroup
Clean the project and clean the build folder.
清理项目并清理构建文件夹。
Project->Clean
Project-> (hold alt) Clean
项目->清洁
项目->(按住 alt)清理
I have ran into many issues after upgrading and a full clean has fixed them.
升级后我遇到了很多问题,完全清理已修复它们。
回答by Naveen Ramanathan
Can you try deleting the app from the device and also deleting the derived directory in Xcode and trying again
您能否尝试从设备中删除应用程序并删除 Xcode 中的派生目录并重试