xcode Cocoapods frameworks.sh 错误:没有那个文件

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

Cocoapods frameworks.sh error: no such file

xcodecocoapods

提问by Amalie

So I'm fairly new at both Swift and working with cocoapods, and after spending several days of researching I cannot figure out why my project isn't building. I get the following error:

所以我在 Swift 和 cocoapods 方面都是新手,经过几天的研究后,我无法弄清楚为什么我的项目没有建立。我收到以下错误:

(My project)/Pods/Target Support Files/Pods-(My project)/Pods-(My project)-frameworks.sh: No such file or directory

(我的项目)/Pods/Target Support Files/Pods-(我的项目)/Pods-(我的项目)-frameworks.sh:没有那个文件或目录

I am using Xcode 7.2.1 and Cocoapods 0.39.0 and I seem to have tried all the troubleshooting tips from Cocoapods' website. Can anyone tell me what I need to do to make it work?

我正在使用 Xcode 7.2.1 和 Cocoapods 0.39.0,我似乎已经尝试了 Cocoapods 网站上的所有故障排除技巧。谁能告诉我我需要做什么才能使它工作?

My podfile:

我的播客文件:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
use_frameworks!

pod 'GoogleMaps'
pod 'FontAwesome.swift'
pod 'Lock', '~> 1.21'
pod 'JWTDecode', '~> 1.0'
pod 'Lock-Facebook', '~> 2.1'
pod 'SimpleKeychain', '~> 0.7'
pod 'Bolts', '~> 1.6'
pod 'FBSDKCoreKit', '~> 4.1'
pod 'FBSDKLoginKit', '~> 4.1'
pod 'MBProgressHUD', '~> 0.9.2'
pod 'Alamofire', '~> 2.0'
pod 'CocoaLumberHyman/Swift'
pod 'AFNetworking', '~> 2.5'
pod 'Auth0', '~> 0.2'

回答by Sheamus

You're probably missing the target block for your target, in the Podfile.

您可能在 Podfile 中缺少目标的目标块。

I added a target to my project, and forgot to add a target block to the Podfile for that target, and I had the same error.

我在我的项目中添加了一个目标,但忘记为该目标的 Podfile 添加一个目标块,我遇到了同样的错误。

(My project)/Pods/Target Support Files/Pods-(My project)/Pods-(My project)-frameworks.sh: No such file or directory

(我的项目)/Pods/Target Support Files/Pods-(我的项目)/Pods-(我的项目)-frameworks.sh:没有那个文件或目录

The path components are actually named after the target:
(My project)/Pods/Target Support Files/Pods-[target]/Pods-[target]-frameworks.sh

路径组件实际上是以目标命名的:(
我的项目)/Pods/Target Support Files/Pods-[target]/Pods-[target]-frameworks.sh

Cocoapods builds configuration files for each target that you specify. Try adding a target entry to your Podfile, like so:

Cocoapods 为您指定的每个目标构建配置文件。尝试向 Podfile 添加目标条目,如下所示:

target "SOME TARGET" do
    specify pods here
end

If you end up adding a lot of targets, it might be a good idea to define pod groups that you can easily use inside your target entries. So, you would define your groups above your target entries, like so:

如果您最终添加了很多目标,那么定义可以在目标条目中轻松使用的 pod 组可能是个好主意。因此,您可以在目标条目上方定义组,如下所示:

def commonPods
    specify pods here
end

Then you can use the group name in your pod entry, instead of copying all the pod entries for every target:

然后您可以在 pod 条目中使用组名,而不是复制每个目标的所有 pod 条目:

target "SOME TARGET" do
    commonPods
end

Adding the target entry in your Podfile will cause CocoaPods to generate a new set of files the next time you run pod install. However, before you run that command, you will probably need to set your configurations to None, so that Cocoapods can assign its own configuration. Here's how to do that:

在您的 Podfile 中添加目标条目将导致 CocoaPods 在您下次运行时生成一组新文件pod install。但是,在运行该命令之前,您可能需要将配置设置为None,以便 Cocoapods 可以分配自己的配置。以下是如何做到这一点:

  1. Go to your project-level target
  2. For each configuration listed under Configurations, select Nonefor your target, in the drop-down menu under Based on Configuration File.
  1. 转到您的项目级目标
  2. 对于Configurations 下列出的每个配置None,在 下的下拉菜单中为您的目标选择Based on Configuration File

These steps will eliminate the Cocoapods warning that reads:

这些步骤将消除 Cocoapods 警告,内容如下:

CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all...

CocoaPods 没有设置你项目的基本配置,因为你的项目已经有一个自定义配置集。为了让 CocoaPods 集成工作...

Once you've edited your Podfile and you nullified your configurations, you're ready to run pod installon the command line. After the process is completed, check back with your base configuration settings, and note that they have been set to the configuration file that was generated by CocoaPods!

一旦您编辑了 Podfile 并取消了配置,您就可以pod install在命令行上运行了。该过程完成后,检查您的基本配置设置,并注意它们已设置为 CocoaPods 生成的配置文件!

I hope that helps!

我希望这有帮助!

回答by Qun Li

My problem is that " blablabla Pods-XXXX-frameworks.sh: No such file or directory"

我的问题是“blablabla Pods-XXXX-frameworks.sh:没有这样的文件或目录”

Firstly, I fix it by using command line "pod install" , it has nothing effection.

首先,我使用命令行“pod install”修复它,它没有任何影响。

The finally solution : Touch "Build Phases" -> "Embed Pods Frameworks" ,you can see the path :XXXXX.sh" Be sure that the XXX.sh is the same as your project's. if not, change the path. Then clean and build. It's done.

最后的解决方案:点击“Build Phases”->“Embed Pods Frameworks”,可以看到路径:XXXXX.sh” 确保XXX.sh和你的项目是一样的。如果不是,改变路径。然后清理并构建。它完成了。

回答by Terry Tores

This is kind of dumb, but it happened to me:

这有点愚蠢,但它发生在我身上:

You might be in the wrong directory.

您可能在错误的目录中。

I was running pod installfrom directory Desktop/Project/Project Files, and I kept getting an error like this.

pod install从 directory运行Desktop/Project/Project Files,我不断收到这样的错误。

Then I realized I was in one step too far, so I went up to directory Desktop/Project, and it worked.

然后我意识到我一步太远了,所以我转到目录Desktop/Project,它起作用了。

As to why pod installeven ran considering the Podfile was in Desktop/Projectand not Desktop/Project/Project Files... ˉ\_(ツ)_/ˉ

至于为什么pod install考虑到Podfile在Desktop/Project而不是Desktop/Project/Project Files...... ˉ\_(ツ)_/ˉ