安装的 iOS Cocoapods -pod(MBProgressHUD) 给出错误停留在 "Analyzing dependencies"和 "Header file missing"

标签 ios cocoapods mbprogresshud

我已经安装了 2 个 pod MBProgessHUDPEPhotocropEditor 直到现在它都可以正常工作,但突然我得到了 MBProgressHUD.h 文件不可用的错误。我尝试使用 pod update 并再次使用 pod install 命令,但仍然无法解决问题。当我同时启动两个命令终端时,都停留在

Analysing dependencies.

Stuck at Analysing dependencies

pod 看起来是红色的。

pods in red color

最佳答案

我的问题已通过以下步骤解决。

1) 将您的项目备份到其他地方。

2) 打开 Terminal ,使用 cd 命令进入你的项目目录。

3) 首先输入这个命令

设置你的pod:

$ pod repo remove master
$ pod setup
$ pod install

注意
这需要时间。所以,不要 panic 等待几分钟。

编辑:- 完成这一切后,如果您发现类似

的错误

MBProgressHUD.h file not found ( any of pod related header file)

您还需要遵循此过程。

您需要检查 Pod 头文件是否在 Pods/Headers 中正确链接。 (所有图像都以正确的设置给出)

WIKI Cocoapods Troubleshooting简要说明。

1) 如果某些东西似乎不起作用,首先确保您没有完全覆盖项目build设置中 Pods.xcconfig 文件中设置的任何选项。要从项目的build设置中向选项添加值,请在值列表前加上 $(inherited)。

$(inherited)

2) 如果 Xcode 找不到依赖项的 header :

检查 Pod 头文件是否在 Pods/Headers 中正确链接,并且您没有覆盖 HEADER_SEARCH_PATHS(参见 #1)。 确保您的项目正在使用 Pods.xcconfig。要检查此项,请选择您的项目文件,然后在第二个 Pane 中再次选择它并在第三个 Pane 中打开“信息”部分。在配置下,您应该为需要安装 pod 的每个配置选择 Pods.xcconfig。

Make sure your project is using correct file

如果 Xcode 仍然找不到它们,作为最后的手段,您可以在导入之前添加,例如#import "Pods/SSZipArchive.h"

如果只有 Headerfile missing Error,则不需要包括以下步骤。

如果有人找不到合适的选项,下面的线条和图片可供引用。

3) 如果您收到有关无法识别的 C 编译器命令行选项的错误,例如cc1obj:错误:无法识别的命令行选项“-Wno-sign-conversion”:

确保您的项目build设置配置为使用“Apple LLVM 编译器”(clang)

Project Build setting are configured to use "Apple LLVM compiler" 您是否正在设置 CC、CPP 或 CXX 环境变量,例如在你的 ~/.profile 中?这可能会干扰 Xcode 构建过程。从 ~/.profile 中删除环境变量。 ~/.profile 位置

1)open Settings > General
2) Scroll to the bottom and open Profiles. If you do not see a "Profiles" section, you do not have a configuration profile installed.

在“个人资料”部分,选择您要删除的个人资料。

4) 如果 Xcode 在链接时报错,例如找不到 -lPods 的库,它不检测隐式依赖项:

Go to Product > Edit Scheme
Click on Build
   ![Edit scheme][6]
Add the Pods static library, and make sure it's at the top of the list
Clean and build again.
If that doesn't work, verify that the source for the spec you are trying to include has been pulled from github. Do this by looking in 

/ pod /。如果它是空的(它不应该是),验证 ~/.cocoapods/master//.podspec 中是否有正确的 git hub url。 如果仍然不起作用,请检查您的 XCode 构建位置设置。转到 Preferences -> Locations -> Derived Data -> Advanced 并将构建位置设置为“Relative to Workspace”。

Xcode 构建位置设置:- 如果您尝试将应用程序提交到 App Store,并发现“产品”>“存档”在“管理器”中没有产生任何结果: 在 Xcode“Build Settings”中,找到“Skip Install”。在您的应用程序目标上将“Release”的值设置为“NO”。再次构建,它应该可以工作。

关于安装的 iOS Cocoapods -pod(MBProgressHUD) 给出错误停留在 "Analyzing dependencies"和 "Header file missing",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30818505/

相关文章:

ios - MBProgressHUD需要在主线程上访问

ios - leftAnchor 和 leadingAnchor 的区别?

ios - Facebook 分享对话框 : Permission Error - OAuth "Facebook Platform" "insufficient_scope (#200) Permissions error"

ios - <FBGraphUser> 对象数组的 UITableView 滚动索引

ios - CocoaPods 测试目标库未加载退出代码 82

iphone - 如何相对于文本标签向 MBProgressHUD 添加按钮?

ios - 如何删除使用 swift 代码添加的 3D touch 快速操作

ios - 使用 Swift 中的 block 调用 Objective C 方法

swift - 正在安装 Protobuf,但没有在 pod 文件中提及它

ios - 如何使用 GCD 说明后台任务?