xcode 在设备上构建失败,退出代码为 1

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44085504/
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-15 09:59:24  来源:igfitidea点击:

Build on device fails with exit code 1

iosiphonexcode

提问by Oliver Apel

I build an app successfully. After changing a bit, the build and run on simulator works still fine as expected, but the build and run with my physical device fails unexpected:

我成功构建了一个应用程序。稍作更改后,模拟器上的构建和运行仍然可以正常工作,但是使用我的物理设备构建和运行却意外失败:

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Intermediates/WhagooAppFramework.build/Debug-iphoneos/WhagooAppFramework.build/Script-26D4B954E53A2CB72C219E1A.sh cd "/Users/oliverapel/Dropbox/WhaGoO/Project WhaGoO/App.iOS/development" /bin/sh -c /Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Intermediates/WhagooAppFramework.build/Debug-iphoneos/WhagooAppFramework.build/Script-26D4B954E53A2CB72C219E1A.sh

mkdir -p /Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Products/Debug-iphoneos/BerlinCapitalClub.app/Frameworks rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Products/Debug-iphoneos/Alamofire/Alamofire.framework" "/Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Products/Debug-iphoneos/BerlinCapitalClub.app/Frameworks" building file list ... done Alamofire.framework/

sent 147 bytes received 26 bytes 346.00 bytes/sec total size is 1073519 speedup is 6205.31 Code Signing /Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Products/Debug-iphoneos/BerlinCapitalClub.app/Frameworks/Alamofire.framework with Identity iPhone Developer: Oliver Apel (W65P7YG9ZK) /usr/bin/codesign --force --sign B68B8D50CF4B9D2517527291D6F3D051423B194F --preserve-metadata=identifier,entitlements "/Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Products/Debug-iphoneos/BerlinCapitalClub.app/Frameworks/Alamofire.framework" /Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Products/Debug-iphoneos/BerlinCapitalClub.app/Frameworks/Alamofire.framework: User canceled the operation. Command /bin/sh failed with exit code 1

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Intermediates/WhagooAppFramework.build/Debug-iphoneos/WhagooAppFramework.build/WhagooAppFramework.build/WhagooApp-Framework.build/WhagooApp-Framework.25C2A3C1C2C5C5C5C2C5C5C5C5C5C5C5C5C2C5C5C5C5C5C5C5C5C5C5C5C5C5C5C5 /Users/oliverapel/Dropbox/WhaGoO/Project WhaGoO/App.iOS/development" /bin/sh -c /Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Intermediates/WhagooAppFrame -iphoneos/WhagooAppFramework.build/Script-26D4B954E53A2CB72C219E1A.sh

mkdir -p /Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Products/Debug-iphoneos/BerlinCapitalClub.app/Frameworks rsync -av --filter "- CVS/" --filter "- . svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/oliverapel/Library/开发人员/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufpexdicjfdawwbkeht/Build/Products/Debug-iphoneos/Alamofire/Alamofire.framework" "/Users/oliverapel/Library/Developer/Xcode/DerivedData/WhagooAppFramework-ckcaymayjufwwbikesf/ BerlinCapitalClub.app/Frameworks”构建文件列表...完成 Alamofire.framework/

用户取消了操作。命令 /bin/sh 失败,退出代码为 1

In the last line I see user canceled the operation.but I do nothing like this.

在我看到的最后一行,user canceled the operation.但我没有这样做。

I already cleaned build folder, removed derived data and now I don′t know what to do.

我已经清理了构建文件夹,删除了派生数据,现在我不知道该怎么做。

采纳答案by Balaji Ramakrishnan

Try updating Certificates from Preference -> Accounts -> Choose developer account and Proper Team -> View Details -> Download all profiles.

尝试从首选项 -> 帐户 -> 选择开发者帐户和适当的团队 -> 查看详细信息 -> 下载所有配置文件更新证书。

Also, try doing Deep clean using Cmd+Shift+Alt+K. Make sure you have selected correct developer team in your general settings.

另外,尝试使用 Cmd+Shift+Alt+K 进行深度清洁。确保您在常规设置中选择了正确的开发团队。

Also, Change Provisioning to Automatic. So that it will automatically fetch proper certificates.

此外,将供应更改为自动。这样它就会自动获取正确的证书。

After that, Goto Build Phases ->Link Binary frameworks-> Add Frameworks you want. Do this for all targets that you have.

之后,转到构建阶段 -> 链接二进制框架 -> 添加你想要的框架。对您拥有的所有目标执行此操作。

Try this and let me know if error still occurs.

试试这个,如果错误仍然发生,请告诉我。

Hope it helps..

希望能帮助到你..

回答by responser

lock add unlock keychain solve the problem, it' weird.

锁添加解锁钥匙串解决了问题,很奇怪。

回答by Parth Patel

I just simply restarted my MacBook Pro. I found this solution here.

我只是简单地重新启动了我的 MacBook Pro。我在这里找到了这个解决方案。