如何告诉我的Pod头文件在哪里? [英] How do I tell my app where my Pod header files are?

查看:101
本文介绍了如何告诉我的Pod头文件在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题



如何告诉我的Pod头文件在哪里?



设置



我从其他人那里继承了ios应用。我想将锁匠添加到应用中以获取密码。该应用程序已经安装了Pod,但是 pod安装无法正常工作,所以我用gem安装了cocoapods并成功了。



然后我pod安装了锁匠,并且一直有效,直到再次运行我的应用程序为止。



错误



现在我在从未碰过的豆荚上遇到这些错误。



在我的Bridge.h文件中,第一行给出了错误

  #import< TPKeyboardAvoiding / TPKeyboardAvoidingScrollView.h> 
#import< DateTools / DateTools.h>

错误响应为:

  /folders/AppName/Application/Bridge.h:15:9:错误:找不到'TPKeyboardAvoiding / TPKeyboardAvoidingScrollView.h'文件
#import< TPKeyboardAvoiding / TPKeyboardAvoidingScrollView.h>
^
< unknown>:0:错误:无法导入桥接标头'/folders/AppName/Application/Bridge.h'

事情是发生完全相同的错误,但如果我删除第一行,仅适用于DateTools。所以,看来我所有吊舱的路径都行不通。



我找不到吊舱路径在哪里,我几乎可以肯定这就是问题所在。 / p>

任何帮助将不胜感激



编辑1



TPKeyboardAvoiding和Datetools目录一样位于Pods文件夹中



Pods / TPKeyboardAvoiding / TPKeyboardAvoiding / TPKeyboardAvoidingScrollView.h



编辑2



我去了Build Settings-> Search Paths-> Header Search Paths



并输入: $(继承)



I还输入了: $(PROJECT_DIR)



但我得到了相同的错误



编辑3



我刚刚意识到我有2套文件夹,分别是Pod,Frameworks和Products。



一个在HostDirectory / AppName中,一个在HostDirectory / Pods中

解决方案

显示带有 cmd + 1 的项目导航器,然后点击您的项目根目录。在打开的窗格中,您将在左侧边栏中看到您的项目和目标。点击您的目标。然后点击顶部的构建设置。点击该按钮,然后搜索标题搜索路径。您应该在那里看到类似的内容:

  $ {PODS_ROOT} / Headers / Public 

如果不存在,也许您的cocoapods安装无法像广告所示那样工作?



如果它是 ,则可以尝试清除派生数据文件夹。我已经通过配置更改解决了一些时髦的事情,这些更改已经解决了,方法是对派生数据文件夹进行核对,然后进行干净的构建。



在终端输入中:

  $ cd $ HOME / Library / Developer / Xcode / DerivedData 
$打开。

然后删除其中带有 AppName 的任何文件夹



编辑:








The Question

How do I tell my app where my Pod header files are.

The Setting

I inherited an ios app from someone else. I wanted to add locksmith to the app for passwords. The app already had pods, but pod install wasnt working so I gem installed cocoapods and it worked.

Then I pod installed locksmith and it worked, until I ran my app again.

The Errors

Now I get these errors on pods that I never messed with.

In my Bridge.h file this first line gives an error

#import <TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h>
#import <DateTools/DateTools.h>

The error response is:

/folders/AppName/Application/Bridge.h:15:9: error: 'TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h' file not found
#import <TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h>
        ^
<unknown>:0: error: failed to import bridging header '/folders/AppName/Application/Bridge.h'

The thing is the exact same error occurs but just for DateTools if I remove the first line. So, it seems the path to all my pods isnt working.

I couldn't find where pod paths are located and I am almost certain that this is the issue.

Any help would be much appreciated

EDIT 1

TPKeyboardAvoiding is present in the Pods folder as is the Datetools directory

Pods/TPKeyboardAvoiding/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h

EDIT 2

I went to the Build Settings -> Search Paths -> Header Search Paths

and entered: $(inherited)

I also entered: $(PROJECT_DIR)

but I get the same errors

EDIT 3

I just realized that I have 2 sets folders named: Pods, Frameworks and Products.

One is in HostDirectory/AppName and one is in HostDirectory/Pods

解决方案

Show project navigator with cmd+1, then tap on your project root. In the pane that opens you will see your Project and Targets in the left sidebar. Tap on your Target. Then tap "Build Settings" at the top. Tap on that and search for "Header Search Path". You should see something like this in there:

"${PODS_ROOT}/Headers/Public"

If that isn't there, perhaps your cocoapods install didn't work as advertised?

If it is there, you may try clearing your derived data folder. I've had funky things happening with configuration changes that I've resolved by nuking the derived data folder and then doing a clean build.

In terminal punch in:

$ cd "$HOME/Library/Developer/Xcode/DerivedData"
$ open .

Then remove any folder there with AppName in it and then rebuild.

Edit:

这篇关于如何告诉我的Pod头文件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆