ld:在xcode 8中找不到框架错误

我使用xcode 8进行开发,使用cocoapods 1.0.1进行框架开发。 安装框架后,我无法build立我的项目。 我得到“ld:框架未find”的错误。 我在pod文件中使用以下行:

# Uncomment this line to define a global platform for your project platform :ios, '9.0' target 'Sample' do use_frameworks! pod 'MBProgressHUD', '~> 0.9' pod 'TPKeyboardAvoiding', '~> 1.2' pod 'SDWebImage', '~> 3.7' pod 'UIActivityIndicator-for-SDWebImage' pod 'UITextView+Placeholder', '~> 1.2' pod 'Alamofire', '~> 4.0' end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '3.0' end end end 

select你的目标 – > General – > Embedded Binary,点击+,然后添加Alamofire.framework

安装框架之后,你closures了你的项目并打开了新创build的工作区?

一旦你开始使用CocoaPods来安装框架,你必须使用工作区,因为它包含了Sample项目和包含框架的Pod项目。

在您的项目目录中,请确保打开.xcworkspace而不是.xcodeproj。

编辑:如果这不是问题,请转到您的示例目标/常规/链接框架和图书馆

你应该只有一个名字应该是这样的:Pods_Sample.framework

如果您只使用cocoa豆荚来安装框架,那么它应该是唯一一个,因为它包含了所有的豆荚。

尝试在use_frameworks之后将project 'APP_NAME.xcodeproj'添加到您的pod use_frameworks! 并再次pod install

如果在pod install后收到下面的警告

 [!] The `APP_NAME [Debug]` target overrides the `FRAMEWORK_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-BasePods-APP_NAME/Pods-BasePods-APP_NAME.debug.xcconfig'. This can lead to problems with the CocoaPods installation 

转到您的目标的生成设置 ,并将$(inherited)添加到框架searchpath