简体   繁体   English

尝试在 swift 项目中使用可可豆荚安装 Purelayout

[英]Trying to install Purelayout using cocoa pods in swift project

I am currently having problems installing Pure Layout using Cocoa Pods.我目前在使用 Cocoa Pods 安装 Pure Layout 时遇到问题。 Ive managed to install it fine in a blank project with no problems.我设法将它安装在一个空白项目中,没有任何问题。 But when installing into my project i keep getting the following error:但是当安装到我的项目中时,我不断收到以下错误:

ld: framework not found PureLayout clang: error: linker command failed with exit code 1 (use -v to see invocation) ld:未找到框架 PureLayout clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

Ive had a search through stack overflow for any possible solutions and have tried adding the framework search path to the target, trying to delete cocoa pods and do a fresh install onto the project.我已经通过堆栈溢出搜索任何可能的解决方案,并尝试将框架搜索路径添加到目标,尝试删除可可豆荚并在项目上进行全新安装。

Initially before adding 'PureLayout' to the pod file i got a similar error:最初在将“PureLayout”添加到 pod 文件之前,我遇到了类似的错误:

ld: framework not found Pods ld:框架未找到 Pods

To resolve this i removed the red pod framework file from the linked library and framework folder.为了解决这个问题,我从链接库和框架文件夹中删除了红色 pod 框架文件。 Which then built fine.然后构建得很好。

Thank you in advance for anyone who helps me solve this.预先感谢任何帮助我解决此问题的人。

Below is my Podfile:以下是我的 Podfile:

# Uncomment this line to define a global platform for your project
platform :ios, '8.1'
# Uncomment this line if you're using Swift
use_frameworks!

target '****' do

pod 'Google/Analytics'
pod 'Fabric'
pod 'Crashlytics'
pod 'PureLayout'

end

target '****Tests' do

end

Managed to solve this issue by:设法通过以下方式解决此问题:

-Select Pods Project -Build Settings -Set BaseSDK to iOS SDK (since pod install clears it) -Set Build Valid Architecture Only to NO. - 选择 Pods 项目 - 构建设置 - 将 BaseSDK 设置为 iOS SDK(因为 pod install 清除了它) - 将仅构建有效架构设置为否。

Following this process the project now builds.在此过程之后,项目现在构建。 I was able to import Pure Layout into my Bridging Header and access the pure layout functions in any of my view controller classes.我能够将纯布局导入到我的桥接头中,并在我的任何视图控制器类中访问纯布局功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM