使用Xcode 8和Swift 3.0获得"没有这样的模块'RxSwift'"

Jin*_*ian 1 xcode cocoapods swift rx-swift

我尝试在我的项目中使用RxSwift.我的podfile如下所示,↓

在此输入图像描述

我收到了这个错误:

在此输入图像描述

这是我的Link Binary With Libraries状态:

在此输入图像描述

我试过修复它超过三个小时.但网站上的答案对我不起作用......

Par*_*oja 9

替换你的Podfile如下:

platform :ios, '9.0'

target 'RxStudy' do
    use_frameworks!

    pod 'RxSwift'
    pod 'RxCocoa'

    target 'RxStudyTests' do
        #Add pod here if you want the access of pod in Tests target.
        #Example: pod 'RxSwift'
    end

    target 'RxStudyUITests' do
        #Add pod here if you want the access of pod in Tests target.
        #Example: pod 'RxSwift'
    end

end
Run Code Online (Sandbox Code Playgroud)

您的Podfile问题在于您尝试在测试目标中添加pod而不是实际项目目标.如上所述更改文件后,再次安装Pod,然后运行项目,即使您收到"No such module error",因为它可能是第一次发生.


Abe*_*eyh 6

您正在将pod插入测试目标中,而不是插入项目目标中.

真实的:

# Uncomment this line to define a global platform for your project
platform :ios, '9.0'

target 'RxStudy' do
    # Comment this line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!

    # Pods for ProjectName
    # Insert your pods here
    pod 'RxSwift'
    pod 'RxCocoa'

    target 'RxStudyTests' do
        inherit! :search_paths
        # Pods for testing
    end

    target 'RxStudyUITests' do
        inherit! :search_paths
        # Pods for testing
    end

end
Run Code Online (Sandbox Code Playgroud)