ld:在xcode 8中找不到框架错误 [英] ld: framework not found error in xcode 8

查看:101
本文介绍了ld:在xcode 8中找不到框架错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将xcode 8用于开发,将cocoapods 1.0.1用于框架。安装框架后,我无法构建项目。我收到 ld:找不到框架错误。我在pod文件中使用了以下行:

I am using xcode 8 for development and cocoapods 1.0.1 for frameworks. After installing frameworks, i couldn't able to build my project. I am getting "ld: framework not found" error. I am using following lines in pod file:

# 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


推荐答案

在安装框架之后,您是否关闭了项目并打开了新创建的工作区?

After installing the frameworks, did you closed your project and opened the newly created workspace?

一旦开始使用CocoaPods安装框架,则必须使用工作空间,因为它包含您的Sample项目和包含框架的Pod项目。

Once you start using CocoaPods to install framework, you must use the workspace as it includes your Sample project and the Pod project containing the frameworks.

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

In you project directory, make sure to open the .xcworkspace instead of .xcodeproj.

编辑:
如果不是问题,请转到样本目标/常规/链接框架和库

If that is not the issue, go to your Sample target/General/Linked Framework and Librairies

您应该只使用一个名称如下的名称:Pods_Sample .framework

You should only have one that should be name something like: Pods_Sample.framework

如果您仅使用可可豆荚来安装框架,那么它应该是那里唯一的框架,因为它包括所有豆荚。

If you are only using cocoa pods to install frameworks it should be the only one there as it includes all the pods.

这篇关于ld:在xcode 8中找不到框架错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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