芒果iOS开发之CocoaPods:Pods written in Swift can only be integrated as frameworks; add `use_frameworks!`
来源:互联网 发布:手机淘宝装修新品上架 编辑:程序博客网 时间:2024/05/01 03:19
【主要内容:】
1. 错误起因
2. 错误提示
3. 解决问题办法
一、错误起因:
今天新创建了一个Xcode工程,准备安装CocoaPods,下边是我添加的库:
二、错误提示
然后pod install过程中出现如下问题:
[!] Pods written in Swift can only be integrated as frameworks; add `use_frameworks!` to your Podfile or target to opt into using it. The Swift Pods being used are: ReactiveCocoa and Result
如图:
三、 解决问题办法
根据错误提示说:Pod写入Swift的只能是一个完整的框架;在Podfile文件或目标来选择使用“use_frameworks!”。
那么按照错误提示打开打开Podfile,打开Podfile命令是:vim Podfile。然后按字母“i(nsert)”插入use_frameworks!
注意:
use_frameworks!中的“!"必须是英文状态的感叹号。
这有一写官方的解释,大家请自行翻译:
Because Apple doesn't let you build static libraries that contain Swift. Unlike Objective-C, Apple doesn't ship the Swift standard runtime libraries with iOS. This decouples the language version from the platform version. When you build an app with Swift, you're responsible yourself to ship them. By default, Xcode uses swift-stdlib-tool to handle copying the Swift runtime dylibs, but the tooling falls short when attempting to ship frameworks that use Swift with an app that is Objective-C only. Your app executable and the frameworks you ship will all use the same set of dylibs, which are embedded into the Frameworks subdirectory of the application bundle.
First, that's because you can't link against different versions of the standard libraries. Furthermore it is desirable to embed them only once and not multiple times, because of constraints to memory size and network speed, which are relevant for distribution. You can make CocoaPods integrate to your project via frameworks instead of static libraries by specifying use_frameworks!. If that's not present, you won't be able to integrate dependencies, if you depend on a pod which includes Swift source code.
然后就可以安装成功了:
欢迎大家关注“芒果iOS”微信公众账号,芒果会经常为大家分享好的技术文章:
- 芒果iOS开发之CocoaPods:Pods written in Swift can only be integrated as frameworks; add `use_frameworks!`
- [!] Pods written in Swift can only be integrated as frameworks; add `use_frameworks!` to your Podfil
- Pods written in Swift can only be integrated as frameworks; add `use_frameworks!` to your Podfile or
- [!] Pods written in Swift can only be integrated as frameworks; add `use_frameworks!` to your Podfil
- [!] Pods written in Swift can only be integrated as frameworks; add `use_frameworks!` to your Podfil
- Pods written in Swift can only be integrated as frameworks
- Pods written in Swift can only be integrated as frameworks
- Pods written in Swift can only be integrated as frameworks
- 使用cocopods导入第三方库报错 : [!] Pods written in Swift can only be integrated as frameworks; add `use_framew
- [Swift]Pods written in Swift can only be integrated as frameworks;
- 关于Pods written in Swift can only be integrated as frameworks问题的解决
- pod 遇到无法 pod install 或者 pod update Pods written in Swift can only be integrated as frameworks; this
- 芒果iOS开发之Cocoapods安装教程
- 芒果iOS开发之ReactiveCocoa:Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configure
- 芒果iOS开发之Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.
- 芒果iOS开发之Swift教程01-Swift基础
- 芒果iOS开发之Swift教程02-Swift基本数据类型
- 芒果iOS开发之Swift教程03-Swift基础
- mysq中文l乱码解决
- 收藏一些比较有用的ADB命令
- Python中的函数和包
- 自学-ES6篇-Set和Map数据结构
- 根据User Agent参数的各个字段Mozilla/5.0/4.0-AppleWebKit/Chrome/Safari/Firefox/Opera/MSIE来确定/判断客户端使用什么浏览器
- 芒果iOS开发之CocoaPods:Pods written in Swift can only be integrated as frameworks; add `use_frameworks!`
- DOM知识总结
- Android 隐藏键盘的方法
- Oracle 12c RAC 到单机实例 DATAGUARD搭建
- hdu1087 DP水题
- 完全备份、差异备份以及增量备份的区别
- Java Web开发中路径问题小结
- JSP的编译指令
- Java中的内部类和匿名类