ios Xcode /Podfile.lock:没有那个文件

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

Xcode /Podfile.lock: No such file

iosxcodecordova

提问by TheJokerAEZ

I am trying to run an ionic app on xcode. But xcode throws an apple match-o linker error. I get this error, when I get this after I have runned the following command:

我正在尝试在 xcode 上运行一个离子应用程序。但是 xcode 会抛出一个 apple match-o 链接器错误。我收到此错误,当我运行以下命令后收到此错误时:

cordova plugin add phonegap-plugin-push --variable SENDER_ID=5****** --save

I need this plugin, for push notifications. After a research on google, I founded that I need to have Cocoapods installed in the projects. But after installing Cocoapods & pod install. I get the following error, when I start the "project.xcworkspace".

我需要这个插件,用于推送通知。在google上研究之后,我发现我需要在项目中安装Cocoapods。但是在安装 Cocoapods 和 pod install 之后。当我启动“project.xcworkspace”时,出现以下错误。

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.

I tried to rebuild/clean project or install pod again. But it did not fixed for me.

我尝试重建/清理项目或再次安装 pod。但它并没有为我修复。

Can someone help me?

有人能帮我吗?

EDIT -> new Error

Apple Mach-O Linker (ld) Error Group

clang: error: linker command failed with exit code 1 (use -v to see invocation)

编辑 -> 新错误

Apple Mach-O 链接器 (ld) 错误组

clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

I am getting this error, when i have fixed the error with pods.

当我用 pod 修复了错误时,我收到了这个错误。

回答by anas.p

If you are setting up environment setup in your project, you have to choose corresponding pods target in configuration.

如果您在项目中设置环境设置,则必须在配置中选择相应的 pods 目标。

enter image description here

在此处输入图片说明

回答by Venu Gopal Tewari

Update your CocoaPods installation first ("sudo gem install cocoapods") then remove everything related to POD from project directory except .podfile. Run "pod install" on terminal and open your project using workspace file.

首先更新您的 CocoaPods 安装(“sudo gem install cocoapods”),然后从项目目录中删除与 POD 相关的所有内容,但 .podfile 除外。在终端上运行“pod install”并使用工作区文件打开您的项目。

回答by Joe

1- Remove PODS folder from project folder and then perform pod installand open project using .xcworkspacefile.

1- 从项目文件夹中删除 PODS 文件夹,然后pod install使用.xcworkspace文件执行和打开项目。

If above one don't work, go to Xcode Build phaseand check for path in scripts added by PODS(usually with podsword in there title), sometimes for hybrid project the path was not correct for podfile.lockand manifest.lockfile lookup in the script.

如果以上一个不起作用,请转到 Xcode Build 阶段并检查由 PODS 添加的脚本中的路径(通常在标题中带有pods词),有时对于混合项目,路径不正确podfile.lockmanifest.lock在脚本中查找文件。

回答by Praful

Easiest Solution which worked for me:

对我有用的最简单的解决方案:

  1. Open terminal inside your project directory
  2. Change directory to 'ios' (cd ios)
  3. Type 'pod install' and wait for dependencies getting downloaded and installed
  1. 在项目目录中打开终端
  2. 将目录更改为“ios”(cd ios)
  3. 输入“pod install”并等待下载和安装依赖项

I hope this will help someone out!

我希望这会帮助别人!

回答by iOS

In my case, I updated cocoapods and the problem was solved.

就我而言,我更新了 cocoapods,问题解决了。

gem install cocoapods --user-install

gem install cocoapods --user-install

回答by Lee Toan

My case, Please:

我的情况,请:

  1. Xcode → File → Workspace Settings.

  2. Make sure in tag: Build System → New Build System.

  3. Please copy your Podfile.

  4. Delete Podfile, Podfile.lock, Pods Folder in your root app folder, like this.

  5. Next Step, Open <YourProject>.xcodeproj. You should use Terminal by: open <YourProject>.xcodeproj. (Remember not .xcworkspace)

  6. In Pods tag, delete these files, like this:

    • <Pods-YOURPROJECT>.debug.xcconfig
    • <Pods-YOURPROJECT>.release.xcconfig
  7. Pod init and Pod install your Project again.

  8. Open <YOUR PROJECT>.xcworkspace, with Terminal: open YOURPROJECT.xcodeproj

  9. CMD+SHIFT+Kto clean build.

  10. CMD+Bto build again.

  11. Enjoy

  1. Xcode → 文件 → 工作区设置。

  2. 确保在标签中:构建系统→新建构建系统。

  3. 请复制您的 Podfile。

  4. 删除根应用文件夹中的 Podfile、Podfile.lock、Pods 文件夹,如下所示

  5. 下一步,打开<YourProject>.xcodeproj。你应该使用终端: open <YourProject>.xcodeproj。(不记得了.xcworkspace

  6. 在 Pods 标签中,删除这些文件,如下所示

    • <Pods-YOURPROJECT>.debug.xcconfig
    • <Pods-YOURPROJECT>.release.xcconfig
  7. Pod init 和 Pod 再次安装您的项目。

  8. 打开<YOUR PROJECT>.xcworkspace,终端:open YOURPROJECT.xcodeproj

  9. CMD+ SHIFT+K到干净的构建。

  10. CMD+B重新构建。

  11. 享受

回答by Paul Schorey

For my Cordova project doing pod init in the ios folder fixed the issue.

对于我的 Cordova 项目,在 ios 文件夹中执行 pod init 修复了该问题。

From your Cordova project root directory you would:

从您的 Cordova 项目根目录,您将:

cd /platforms/ios
pod init
cd ../../
cordova build ios

回答by Santosh

Last year I had used the similar plugin, when I was working on an App Update, I came to know that this plugin got deprecated. Not sure about the above one.

去年我使用过类似的插件,当我在做应用更新时,我才知道这个插件被弃用了。不确定上面的那个。

So I've working using FCM. I had the similar problem while working with FCM. After having spent nearly a day on researching on this I've found a cordova plugin which takes care of pods in cordova.

所以我一直在使用 FCM。我在使用 FCM 时遇到了类似的问题。在花了将近一天的时间研究这个之后,我发现了一个cordova插件,它可以处理cordova中的pods。

Plugin name:

插件名称

cordova plugin add cordova-plugin-cocoapod-support --save

科尔多瓦插件添加科尔多瓦插件-cocoapod-support --save

Please Note: After installing this plugin, there's no need of podinit, or opening the pod and installing it. This plugin will take care of it. It will create a AppDelegate inside the plugin folder where it will handle everything - you can retrieve Push Token as well in DEV mode if you wish.

请注意:安装此插件后,不需要podinit,也不需要打开 pod 并安装它。这个插件会处理它。它将在插件文件夹中创建一个 AppDelegate,它将处理所有内容 - 如果您愿意,您也可以在 DEV 模式下检索推送令牌。

After I installed this plugin and build iOS, there were no issues.

在我安装这个插件并构建 iOS 之后,没有任何问题。

** Note ** Please ensure while working with FCM, no other google plugins are installed, they'll conflict. Earlier I had GoogleAnalytics plugin, as it's now covers within FCM - you can remove Old GoogleAnalytics plugin in order to work with FCM without issues.

** 注意** 请确保在使用 FCM 时,没有安装其他谷歌插件,它们会发生冲突。早些时候我有 GoogleAnalytics 插件,因为它现在包含在 FCM 中 - 您可以删除旧的 GoogleAnalytics 插件以便与 FCM 一起使用而不会出现问题。