在CocoaPods 1.5中使用静态库在导入时没有这样的模块 [英] Using static libraries with CocoaPods 1.5 no such module at import

查看:323
本文介绍了在CocoaPods 1.5中使用静态库在导入时没有这样的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着CocoaPods 1.5的发布,我试图从项目中的10-15个动态Pod迁移到将其作为静态库,以加快我的应用程序启动时间。

With CocoaPods 1.5 released I am trying to migrate from having 10-15 dynamic pods in my projects to having them as static libraries instead, with the goal of speeding up my app start time.

在此阶段,我的简单(即简单化)尝试是在运行pod安装时删除use_frameworks命令。这确实将我的pod转换为静态库。但是,在尝试导入Pod时,它还会在我的整个项目中产生一系列没有这样的模块(例如,没有这样的模块PureLayout或没有这样的模块FirebaseMessaging)。

At this stage my simple (i.e., simplistic) attempt has been to remove the use_frameworks command when running my pod install. This indeed transforms my pods to static libraries. But it also produces a series of "No Such Module" throughout my project when trying to import my Pods (e.g., "No such Module PureLayout or no such Module FirebaseMessaging).

我并不精通Pod和动态/静态库的所有复杂功能,并且在过去的一天里,我一直在寻找有关如何为Swift项目正确导入,使用和部署静态库的良好文档,但找不到明确的指导方针。

I am not super versed in all the intricacies of pods and dynamic/ static libraries and have tried for the past day to find good documentation on how to properly import, use and deploy static libraries for a Swift Project but could not find clear guidelines.

我正在使用XCode 10.1和CocoaPod 1.5.2(客户端版本)。

I am using XCode 10.1 and CocoaPod 1.5.2 (client version).

有人可以帮助我吗提供有关如何从动态库转移到静态库的详细说明的链接?

Could anyone help me by providing links to detailed instructions on how to move from dynamic to static libraries?

谢谢!!

推荐答案

CocoaPods 1.5.0引入了 use_modular_headers!仍可为静态库提供模块支持,详情请参见发行说明

CocoaPods 1.5.0 introduced use_modular_headers! to still provide module support with static libraries. Details in the release notes.

您也可以选择

我还建议您试用CocoaPods 1.6.0 beta,因为它有一些针对静态/动态库的修复程序,框架问题。

I'd also recommend trying out the CocoaPods 1.6.0 beta since it has several fixes for static/dynamic library and framework issues.

2020更新

CocoaPods 1.9.0 引入了 use_frameworks! :linkage => :static 会生成带有静态链接库和模块映射文件的完整框架。与 use_modular_headers!相比,这通常是更好的方法。

CocoaPods 1.9.0 introduced use_frameworks! :linkage => :static which will generate full frameworks with statically linked libraries and module map files. This is typically an even better approach than use_modular_headers!.

这篇关于在CocoaPods 1.5中使用静态库在导入时没有这样的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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