如何正确安装“ RxSwift”模块?

时间:2018-11-24 18:50:26

标签: swift xcode rx-swift

我正在尝试构建一个使用RxSwift模块的项目,XCode一直抱怨“没有这样的模块RxSwift”错误...

我尝试多次安装此模块,在终端机中,pod install后收到以下消息

    Analyzing dependencies
Downloading dependencies
Using RxCocoa (4.3.1)
Using RxSwift (4.3.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.

[!] Automatically assigning platform `ios` with version `11.4` on target `BTCPrice` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] Automatically assigning platform `watchos` with version `4.3` on target `WatchApp` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] Automatically assigning platform `watchos` with version `4.3` on target `WatchApp Extension` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] The `BTCPriceTests [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-BTCPriceTests/Pods-BTCPriceTests.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `BTCPriceTests [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-BTCPriceTests/Pods-BTCPriceTests.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

据我所知,已经安装了RxSwift,为什么Xcode一直抱怨它?

我正在执行.xcworkspace文件。

预先感谢您的回答!

1 个答案:

答案 0 :(得分:0)

How to remove CocoaPods from a project?

安装Pod文件的简单步骤:

关闭Xcode项目

1。打开终端(命令+空格键和类型终端)

2。在终端上设置项目路径。(cd桌面/ PodDemos)

3。在终端上键入命令: sudo gem install cocoapods

4。命令: pod init

5。转到项目的pod文件并添加要安装的pod(命令:打开podfile

6。添加到pod文件中: pod'RxSwift'

pod'RxCocoa'

7.Command:安装Pod

8。从终端打开您的项目 命令:打开PodDemos.xcworkspace

OR

转到项目文件夹并打开PodDemos.xcworkspace