美文网首页可能会用到
xcode Command /bin/sh failed wit

xcode Command /bin/sh failed wit

作者: BakerCheng | 来源:发表于2017-07-12 18:24 被阅读1276次

前言:库没有引入对都会出现这样的问题。什么framework没有加对啦。重复加framework了。都会报这个错误,所以这样的错误非常讨厌,网络上也有很多总结,今天我只写我自己的坑,这个是别人没有总结到的。


问题:真机不能编译,模拟器可以跑。不是签名的问题。错误看的让人很容易是以为签名错误!

Xcode : 8.1(8B62).

mkdir -p /Users/chengsongbin/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/Gululu.app/Frameworks

rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/chengsongbin/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/SDWebImage/SDWebImage.framework" "/Users/chengsongbin/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/Gululu.app/Frameworks"

building file list ... done

SDWebImage.framework/

SDWebImage.framework/Info.plist

SDWebImage.framework/SDWebImage

sent 372090 bytes  received 70 bytes  744320.00 bytes/sec

total size is 371799  speedup is 1.00

Code Signing /Users/chengsongbin/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/Gululu.app/Frameworks/SDWebImage.framework with Identity iPhone Developer: Binker Cheng (4KHY49FL2N)

/usr/bin/codesign --force --sign 9954DEE76D4D418A6171D3502D08C8DFF4649C9C  --preserve-metadata=identifier,entitlements "/Users/chengsongbin/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/Gululu.app/Frameworks/SDWebImage.framework"

rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/chengsongbin/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/SnapKit.framework" "/Users/chengsongbin/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/Gululu.app/Frameworks"

building file list ... done

SnapKit.framework/

sent 101 bytes  received 26 bytes  254.00 bytes/sec

total size is 0  speedup is 0.00

Code Signing /Users/chengsongbin/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/Gululu.app/Frameworks/SnapKit.framework with Identity iPhone Developer: Binker Cheng (4KHY49FL2N)

/usr/bin/codesign --force --sign 9954DEE76D4D418A6171D3502D08C8DFF4649C9C  --preserve-metadata=identifier,entitlements "/Users/chengsongbin/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/Gululu.app/Frameworks/SnapKit.framework"

/Users/chengsongbin/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/Gululu.app/Frameworks/SnapKit.framework: bundle format unrecognized, invalid, or unsuitable

Command /bin/sh failed with exit code 1

这是报错的地方,非常让人崩溃。

注意文章报错黑体部分。

我是看不懂为什么,Google “bundle format unrecognized, invalid, or unsuitable”这一段都是说什么Pod里面缺失plist文件。我发现都是有的。所以不是缺少。

后面我进入这个文件目录。

/Users/chengsongbin/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/

发现我有2份SDWebImage和SnapKit的文件目录。其中一个没有list文件。所以才会报上面的错误。只要把没有的删掉。就是删掉不跟你的工程目录一个级的。就好了。

或者全部删掉。在 pod update.

好了。坑踩完毕。

原因分析:是pod file文件目录结构修改的原因。历史上改过多次pod file。然后xcode还会把原来下载的东西保存起来,没有删掉。pod只是把它在工程里面移除!!!

定期更新这个目录。可以清理很多空间!

相关文章

网友评论

  • Twenty_:如果出现上述问题, 而且并不是楼主所说的原因, 可以试试重启电脑.
  • 云逸枫林:正好遇到这个问题,完美解决,多谢。一开始我也以为是签名问题。。。
    云逸枫林:@Baker_cheng 哈哈,顺便也关注一下,加油
    BakerCheng:含泪感谢评论和喜欢。第一次帮助到人了:joy: :sob:

本文标题:xcode Command /bin/sh failed wit

本文链接:https://www.haomeiwen.com/subject/twabhxtx.html