iOS pod ReactiveCocoa报错

在Podfile文件中引入ReactiveCocoa时报错。

target 'ReactiveCocoa' do
pod 'ReactiveCocoa'
end

执行pod install时报错信息如下。

➜  ReactiveCocoa git:(master) ✗ vim Podfile 
➜  ReactiveCocoa git:(master) ✗ pod install
Analyzing dependencies
Downloading dependencies
Installing ReactiveCocoa (5.0.2)
Installing ReactiveSwift (1.1.1)
Installing Result (3.2.1)
[!] 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!字段。就能pod install成功。

target 'ReactiveCocoa' do
pod 'ReactiveCocoa'
use_frameworks!
end

Cmd + R运行连续选择两次later 仍然报错,信息如下。
iOS pod ReactiveCocoa报错_第1张图片

“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be 
configured correctly for targets which use Swift.Use the 
[Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version 
or use the Build Settings editor to configure the build setting directly.

在网上找了很多种答案,选择Pods - ReactiveCocoa - Swift Compiler -Version - Use Legacy Swift Language Version,把Unspecified改成YES。发现还是报错。最后将ReactiveCocoa、ReactiveSwift和Result的Use Legacy Swift Language Version都改为NO才能解决。

你可能感兴趣的:(iOS pod ReactiveCocoa报错)