- The “Swift Language Version” (SW
- The “Swift Language Version” (SW
- The “Swift Language Version” (SW
- The “Swift Language Version” (SW
- The “Swift Language Version” (SW
- The “Swift Language Version” (SW
- The “Swift Language Version” (SW
- swift 第三方库迁移错误解决“Use Legacy Swif
- 【Swift】Swift 2.0 到 Swift 3.0
- ReactiveCocoa 使用Cocoapods安装时遇到的错
在项目中集成ReactiveCoaoa,之前都是采用2..5的版本,这样不会有兼容swift的问题。
今天我在项目中采用了最新的7.1.0的版本,新版本中会有swift的代码,所以需要兼容swift。
1,在终端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, ReactiveSwift, and Result
解决办法是在podfile 中加入如下代码就可以安装成功了
use_frameworks!
podfile.jpg
2,pod 安装成功后,运行项目会报出如标题的错误:
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported
value for targets which use Swift.
解决办法是
swiftVersion.png
分别 选中TARGETS里的ReactiveCocoa、ReactiveSwift、Result, 将Swift Language Version选项改为Swift 4.0即可
3,运行项目可能还会报错
'Masonry.h' file not found with <angled> include; use "quotes" instead
# import.jpg
解决办法是将<Masonry.h>替换成“Masonry.h”,或者将<Masonry.h>替换成<Masonry/Masonry.h>,哪里报错改哪里,再运行项目就OK了!
网友评论