ios 无法打开文件“Pods.xcconfig”,因为没有这样的文件

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

The file “Pods.xcconfig” couldn’t be opened because there is no such file

iosgitcocoapods

提问by user2618875

How to solve this issue. I have downloaded the iOS project from the Git repo and when I try to build, it gives an error:

如何解决这个问题。我已经从 Git 存储库下载了 iOS 项目,当我尝试构建时,它给出了一个错误:

Check dependencies
The file “Pods.xcconfig” couldn't be opened because there is no such file. (/Users/YoGesh/Desktop/Xy-3/Pods/Pods.xcconfig)
PhaseScriptExecution Check\ Pods\ Manifest.lock /Users/YoGesh/Library/Developer/Xcode/DerivedData/Xy-bmwkojrwthnvzdfxthnxeqgesekm/Build/Intermediates/Xy.build/Debug-iphonesimulator/Xy.build/Script-C0451AB63D7F4B73830000BA.sh
    cd /Users/YoGesh/Desktop/Xy-3
    /bin/sh -c /Users/YoGesh/Library/Developer/Xcode/DerivedData/Xy-bmwkojrwthnvzdfxthnxeqgesekm/Build/Intermediates/Xy.build/Debug-iphonesimulator/Xy.build/Script-C0451AB63D7F4B73830000BA.sh

diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

回答by Alex Cio

I found a good hint inside the issuesof CocoaPodson GitHub, try this:

我在on的问题中找到了一个很好的提示,试试这个:CocoaPodsGitHub

  1. Close your project (better close Xcode completely)
  2. Open the Terminal inside your project and execute pod install
  3. Open your project again. If there are still errors clean your project ( Shift+ cmd+ K), after this the errors should be gone.
  1. 关闭您的项目(最好完全关闭 Xcode)
  2. 在您的项目中打开终端并执行 pod install
  3. 再次打开您的项目。如果仍存在错误,清理项目(Shift+ cmd+ K),在此之后的错误应该消失。

回答by Denis Kutlubaev

Restarting Xcodehelped me. Pod updateand installdidn't help.

重新启动Xcode对我有帮助。Pod updateinstall没有帮助。

回答by Rocky Perera

Go to your project directory from the terminal

从终端转到您的项目目录

run "pod update"

运行“吊舱更新”

回答by Michael Hill

Hey i had this same problem, I was getting the following error when running pod update however i didn't realise the update wasn't working.

嘿,我遇到了同样的问题,运行 pod update 时出现以下错误,但我没有意识到更新不起作用。

$ pod update

$ 豆荚更新

Analyzing dependencies /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:422:in `open': No such file or directory

分析依赖关系 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:422:in `open': 没有这样的文件或目录

It was because I forgot to run "pod setup" after installing cocoapods. I ran pod setup from the terminal, followed it up with pod update (or pod install) and everything went to plan.

那是因为我在安装 cocoapods 后忘记运行“pod setup”。我从终端运行 pod setup,然后进行 pod update(或 pod install),一切都按计划进行。

回答by Malder

Closing Xcode, pod update and pod install didn't help me.
I just ran the install cocoapods command again:

关闭 Xcode、pod 更新和 pod 安装对我没有帮助。
我刚刚再次运行了 install cocoapods 命令:

sudo gem install cocoapods

If you see error:

如果您看到错误:

You don't have write permissions for the /usr/bin directory

您没有 /usr/bin 目录的写权限

Use next command:

使用下一个命令:

sudo gem install cocoapods -n /usr/local/bin

回答by A.G

You may be using the Xcode default project file. After installing the framework through pod, you must use the generated xcworkspace in the project folder.

您可能正在使用 Xcode 默认项目文件。通过pod安装框架后,必须使用项目文件夹中生成的xcworkspace。

Example : SampleProject.xcworkspace.

示例:SampleProject.xcworkspace。

回答by KuDji

For those who want to solve this issue and tried to remove the cocoa pods from the project: 1. Open the project, on the left side there must be a folder named Pods 2. Delete the folder and the problem will be solved !!! Do not do this if you need cocoa pods

对于那些想解决这个问题并试图从项目中删除可可豆荚的人: 1. 打开项目,在左侧必须有一个名为 Pods 的文件夹 2. 删除该文件夹,问题就解决了!!!如果您需要可可豆,请不要这样做

回答by R. Mohan

I Tried pod updatecommand in terminal for the project, it did not fix the issue.

pod update在项目的终端中尝试了命令,但没有解决问题。

then I Tried pod installcommand for the same project, it installed all the pod dependencies and the project got indexed and all those type of issues got fixed.

然后我pod install为同一个项目尝试了命令,它安装了所有 pod 依赖项,项目被索引,所有这些类型的问题都得到了修复。

回答by Alan Feng

I've experience a similar situation, for me, it's an error stop all the pods to be updated when I ran pod update.

我遇到过类似的情况,对我来说,当我运行 pod update 时,停止所有要更新的 pod 是一个错误。

Try to resolve the error and run pod update again, clean your project then try to build again.

尝试解决错误并再次运行 pod update,清理您的项目,然后再次尝试构建。

回答by Jefferson Vélez Escobar

  1. close Xcode
  2. pod install
  3. open Xcode
  1. 关闭 Xcode
  2. 吊舱安装
  3. 打开Xcode