xcode 运行自定义 shell 脚本“复制 Pod 资源”错误

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

Run custom shell script 'Copy Pods Resources' error

iosobjective-cxcodeshell

提问by Sabbath

I have recently been encountering with a Xcode build issue. The error message :

我最近遇到了 Xcode 构建问题。错误信息:

PhaseScriptExecution Copy\ Pods\ Resources /Users/XXX/Library/Developer/Xcode/DerivedData/XXXX-ctiynisxuxnyspgkmjrwbzdlcppc/Build/Intermediates/XXXX.build/Debug-iphonesimulator/XXXX.build/Script-CD61667E1C3E477BBD8B461C.sh
    cd "/Users/XXX/XXXXX/03_Project/XXXX-ios"
    /bin/sh -c /Users/XXX/Library/Developer/Xcode/DerivedData/XXXX-ctiynisxuxnyspgkmjrwbzdlcppc/Build/Intermediates/XXXX.build/Debug-iphonesimulator/XXXX.build/Script-CD61667E1C3E477BBD8B461C.sh

ibtool --errors --warnings --notices --output-format human-readable-text --compile /Users/XXX/Library/Developer/Xcode/DerivedData/XXXX-ctiynisxuxnyspgkmjrwbzdlcppc/Build/Products/Debug-iphonesimulator/XXXX.app/PTEAdjustLevelsCell.nib /Users/XXX/XXXXX/03_Project/XXXX-ios/Pods/LumberHymanConsole/Source/Adjust Levels/PTEAdjustLevelsCell.xib --sdk /Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk
ibtool --errors --warnings --notices --output-format human-readable-text --compile /Users/b03931/Library/Developer/Xcode/DerivedData/XXXX-ctiynisxuxnyspgkmjrwbzdlcppc/Build/Products/Debug-iphonesimulator/detox.app/PTEDashboard.nib /Users/XXX/XXXXX/03_Project/XXXX-ios/Pods/LumberHymanConsole/Source/PTEDashboard.xib --sdk /Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk
Command /bin/sh failed with exit code 255

I guess there is something wrong with the 2 files : PTEAdjustLevelsCell.xib and PTEDashboard.xib but have no idea about how to figure out the wrong point exactly. Can anybody tell me the way how to find the problem? Any hint is welcomed and appreciated.

我猜这两个文件有问题:PTEAdjustLevelsCell.xib 和 PTEDashboard.xib 但不知道如何准确找出错误的点。谁能告诉我如何找到问题的方法?欢迎和赞赏任何提示。

回答by sKhan

I think below is the case which also cause this error, there might be other configuration changes as well but you can try this thing once.

我认为下面是也会导致此错误的情况,可能还有其他配置更改,但您可以尝试一次。

  • Project's Target

  • Build Phases check for entries Check Pods Manifest.lockand Copy Pods Resources.

  • Check option Run script only when installingif it has not selected.

  • 项目目标

  • 构建阶段检查条目Check Pods Manifest.lockCopy Pods Resources

  • 如果未选择,则选中仅在安装时运行脚本选项。

Clean build & run again.

清理构建并再次运行。

Hope this may help.

希望这可能会有所帮助。

回答by Feng Lin

I think this cause by the sdk version and xib compiler tool, but xcode could not fix it, you should do something for fix the ibtool. Solutions in this article:ibtool fail

我认为这是由sdk版本和xib编译器工具引起的,但是xcode无法修复它,您应该为修复ibtool做一些事情。本文解决方案:ibtool失败

回答by zhutong

I met the same problem. In the project directory, execute this command:

我遇到了同样的问题。在项目目录中,执行以下命令:

pod update

This solved my problem.

这解决了我的问题。