无法使用CocoaPods安装SDWebImage:" ld:找不到-lSDWebImage"

时间:2016-02-11 12:48:52

标签: ios objective-c cocoapods sdwebimage

我尝试使用Cocoapods将SDWebImage导入我的iOS项目。

所以我安装了Cocoapods,并将这个Podfile创建到我的项目目录中:

platform :ios, '7.0'
target 'MyProjectV6' do
pod 'SDWebImage', '~>3.7'
end

然后我用pod install命令运行它,一切似乎都很好:

Analyzing dependencies
Downloading dependencies
Installing SDWebImage 3.7.5 (was 3.7.5)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

我还在Xcode中看到了在我的项目目录中创建的Pods文件夹。它包含两个.xcconfig文件,如下所示:

GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage"
OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage"
OTHER_LDFLAGS = $(inherited) -ObjC -l"SDWebImage" -framework "ImageIO"
PODS_ROOT = ${SRCROOT}/Pods

但是当我构建我的项目时,我收到了这个错误:

enter image description here

我还有一个" libPods-MyProjectV6.a"添加到我的Frameworks文件夹中,但文本是红色的,所以我猜错了但我不知道是什么......

感谢您的帮助。

2 个答案:

答案 0 :(得分:6)

您是否打开了Workspace或Project文件? 确认您打开第一个

答案 1 :(得分:0)

你试过这个吗?

rm -rf Pods/ Podfile.lock
pod install