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

Rob*_*Rob 1 objective-c ios sdwebimage cocoapods

我正在尝试使用Cocoapods将SDWebImage导入我的iOS项目.

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

platform :ios, '7.0'
target 'MyProjectV6' do
pod 'SDWebImage', '~>3.7'
end
Run Code Online (Sandbox Code Playgroud)

然后我用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.
Run Code Online (Sandbox Code Playgroud)

我还在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
Run Code Online (Sandbox Code Playgroud)

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

在此输入图像描述

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

谢谢你的帮助.

小智 6

你打开了Workspace或Project文件吗?确认您打开第一个