CocoaPods没有正确导入SDK框架

时间:2021-02-11 18:06:49

I have been trying to import the Dropbox-iOS-SDK into my project through CocoaPods, but the framework file doesn't seem to be imported properly. My Podfile looks like this:

我一直试图通过CocoaPods将Dropbox-iOS-SDK导入到我的项目中,但框架文件似乎没有被正确地导入。我的播客文件是这样的:

platform :ios, '7.0'

pod "AFNetworking", "~> 2.0"
pod 'Reachability'
pod 'Facebook-iOS-SDK', '~> 3.9'
pod "Dropbox-iOS-SDK"

I am new to CocoaPods and I'm not sure where I am going wrong. I tried cleaning the project and restarting Xcode. But the Pods Frameworks file still looks like this:

我对可可豆还不熟悉,我不知道我哪里出错了。我尝试清理项目并重新启动Xcode。但是豆荚框架文件仍然是这样的:

CocoaPods没有正确导入SDK框架

As a result of this I am getting the following errors during build:

因此,在构建过程中,我得到以下错误:

CocoaPods没有正确导入SDK框架

Any idea how I can fix this?

你知道我怎么解决这个问题吗?

4 个解决方案

#1


6  

I was adding cocoa pods to an existing project and so I had to remove references to all paths to previously imported frameworks and headers. Once I removed these, everything worked fine.

我在一个现有的项目中添加了cocoa pods,所以我必须删除对之前导入的框架和头的所有路径的引用。一旦我去掉这些,一切都很好。

This is in case someone runs into the same problem.

这是为了防止有人遇到同样的问题。

#2


4  

Same response as Rameez with more precision : As I had previously added libraries without Cocoapod, my project settings were not clean. When running pod install, the "Framework search path" and "header search path" were not set correctly.

和Rameez一样,我的回答更加精确:因为我之前添加了没有Cocoapod的图书馆,所以我的项目设置并不干净。当运行pod安装时,“框架搜索路径”和“标题搜索路径”没有正确设置。

To get the correct value for those two search path :

为了得到这两个搜索路径的正确值:

  1. create an empty project
  2. 创建一个空项目
  3. add the previous podfile in the new project (just change the target name)
  4. 在新项目中添加之前的podfile(只需更改目标名称)
  5. run pod install
  6. 运行舱安装
  7. Look at the Framework and header search path values in the new project
  8. 查看新项目中的框架和头搜索路径值
  9. Copy-paste those values into your previous project settings
  10. 将这些值复制粘贴到以前的项目设置中

#3


1  

For me, the problem was with Other Linker Flags and Runpath Search Paths, which weren't inheriting the settings defined on xcconfig. The following adjustments solved my problem:

对我来说,问题出在其他链接器标志和Runpath搜索路径上,它们没有继承xcconfig中定义的设置。以下的调整解决了我的问题:

Other Linker Flags:

其它的链接器标志:

$(inherited)

Runpath Search Paths:

Runpath搜索路径:

$(inherited)
@executable_path/Frameworks

#4


0  

After pod setup successfully- Take This steps-

在pod设置成功之后-采取这个步骤-

1] touch podfile

1]触摸podfile

2] open -e podfile

2]- e podfile开放

You will then get a text editor file. Now add your files properly. Now Save that and close that window and your Project window also. Go to Finder and you will get an proj.workspace file. Open That one.

然后您将获得一个文本编辑器文件。现在正确地添加文件。现在保存并关闭该窗口和项目窗口。去查找,你会得到一个提示。工作区文件。开放。

Now.......... now under xcode.proj you will find an proj.test. Go there and change deployment Target with your project name.

现在..........现在在xcode中。你会找到一个项目,测试。到那里,使用项目名称更改部署目标。

#1


6  

I was adding cocoa pods to an existing project and so I had to remove references to all paths to previously imported frameworks and headers. Once I removed these, everything worked fine.

我在一个现有的项目中添加了cocoa pods,所以我必须删除对之前导入的框架和头的所有路径的引用。一旦我去掉这些,一切都很好。

This is in case someone runs into the same problem.

这是为了防止有人遇到同样的问题。

#2


4  

Same response as Rameez with more precision : As I had previously added libraries without Cocoapod, my project settings were not clean. When running pod install, the "Framework search path" and "header search path" were not set correctly.

和Rameez一样,我的回答更加精确:因为我之前添加了没有Cocoapod的图书馆,所以我的项目设置并不干净。当运行pod安装时,“框架搜索路径”和“标题搜索路径”没有正确设置。

To get the correct value for those two search path :

为了得到这两个搜索路径的正确值:

  1. create an empty project
  2. 创建一个空项目
  3. add the previous podfile in the new project (just change the target name)
  4. 在新项目中添加之前的podfile(只需更改目标名称)
  5. run pod install
  6. 运行舱安装
  7. Look at the Framework and header search path values in the new project
  8. 查看新项目中的框架和头搜索路径值
  9. Copy-paste those values into your previous project settings
  10. 将这些值复制粘贴到以前的项目设置中

#3


1  

For me, the problem was with Other Linker Flags and Runpath Search Paths, which weren't inheriting the settings defined on xcconfig. The following adjustments solved my problem:

对我来说,问题出在其他链接器标志和Runpath搜索路径上,它们没有继承xcconfig中定义的设置。以下的调整解决了我的问题:

Other Linker Flags:

其它的链接器标志:

$(inherited)

Runpath Search Paths:

Runpath搜索路径:

$(inherited)
@executable_path/Frameworks

#4


0  

After pod setup successfully- Take This steps-

在pod设置成功之后-采取这个步骤-

1] touch podfile

1]触摸podfile

2] open -e podfile

2]- e podfile开放

You will then get a text editor file. Now add your files properly. Now Save that and close that window and your Project window also. Go to Finder and you will get an proj.workspace file. Open That one.

然后您将获得一个文本编辑器文件。现在正确地添加文件。现在保存并关闭该窗口和项目窗口。去查找,你会得到一个提示。工作区文件。开放。

Now.......... now under xcode.proj you will find an proj.test. Go there and change deployment Target with your project name.

现在..........现在在xcode中。你会找到一个项目,测试。到那里,使用项目名称更改部署目标。