Cocoapods 复制资源上的 Xcode 构建失败

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

Xcode Build Fails on Cocoapods Copy Resources

xcodecocoapodsgpuimage

提问by MikeS

I recently added GPUImage to my podfile in Xcode, as follows:

我最近在 Xcode 中将 GPUImage 添加到我的 podfile 中,如下所示:

pod 'GPUImage', '~> 0.1.4'

I don't think the problem I'm having is GPUImage specific, but rather has to do with the fact that GPUImage is the only pod I've added that includes extra resources.

我不认为我遇到的问题是 GPUImage 特定的,而是与 GPUImage 是我添加的唯一包含额外资源的 pod 的事实有关。

My build keeps failing with "Shell Script Invocation Error, exit code 23".

我的构建不断失败,并显示“Shell 脚本调用错误,退出代码 23”。

./Pods/GPUImage/framework/Resources/lookup.png
./Pods/GPUImage/framework/Resources/lookup_amatorka.png
./Pods/GPUImage/framework/Resources/lookup_miss_etikate.png
./Pods/GPUImage/framework/Resources/lookup_soft_elegance_1.png
./Pods/GPUImage/framework/Resources/lookup_soft_elegance_2.png
building file list ... rsync: link_stat "/Pods/GPUImage/framework/Resources/lookup.png" failed: No such file or directory (2)
rsync: link_stat "/Pods/GPUImage/framework/Resources/lookup_amatorka.png" failed: No such file or directory (2)
rsync: link_stat "/Pods/GPUImage/framework/Resources/lookup_miss_etikate.png" failed: No such file or directory (2)
rsync: link_stat "/Pods/GPUImage/framework/Resources/lookup_soft_elegance_1.png" failed: No such file or directory (2)
rsync: link_stat "/Pods/GPUImage/framework/Resources/lookup_soft_elegance_2.png" failed: No such file or directory (2)
done
sent 29 bytes  received 20 bytes  98.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-42/rsync/main.c(992) [sender=2.6.9]
Command /bin/sh failed with exit code 23

I think it's a problem with some sort of build path/pod configuration, but I tried for quite a while to fix it myself and am ready to ask for help... The real annoyance is that I'm not even using those resources! If I go into my Pods-resources.sh file and manually comment out all the "install_resource" lines, everything builds just fine and my project works fine. Of course, that is only a temporary/fragile solution, I'd like to just fix the issue at the source.

我认为这是某种构建路径/pod 配置的问题,但我尝试了很长时间自己修复它并准备寻求帮助......真正的烦恼是我什至没有使用这些资源!如果我进入我的 Pods-resources.sh 文件并手动注释掉所有“install_resource”行,一切都很好,我的项目也能正常工作。当然,这只是一个临时/脆弱的解决方案,我只想从源头上解决问题。

Any ideas on how to fix this issue?

有关如何解决此问题的任何想法?

Some things I've tried:

我尝试过的一些事情:

  • Xcode clean
  • Deletion of derived data
  • Removing GPUImage pod, then installing again
  • Xcode 干净
  • 删除派生数据
  • 删除 GPUImage pod,然后重新安装

回答by Cfr

I'm experiencing the same problem with cocoapods beta (--pre). Reinstall stable version:

我在使用 cocoapods beta ( --pre) 时遇到了同样的问题。重装稳定版:

sudo gem uninstall --all cocoapods
sudo gem install cocoapods

回答by Rivera

Well the files seemto be in the repository so maybe you should check inside your local Pods directory.

好吧,这些文件似乎在存储库中,所以也许您应该检查本地 Pods 目录。

Also you could try to delete the directory and $pod installagain.

您也可以尝试$pod install再次删除该目录。

回答by JoeGalind

For me, it was something different than Cfr's answer. I had an old Pod file I removed from the Podfile, but somehow, it was still on the Schemes. I removed it from the Managed schemes and it worked.

对我来说,这与 Cfr 的回答不同。我有一个从 Podfile 中删除的旧 Pod 文件,但不知何故,它仍然在 Schemes 中。我从托管计划中删除了它并且它起作用了。