Getting "No such module 'RxSwift'" with Xcode 8 and Swift 3.0

14,689

Solution 1

Replace your Podfile like below:

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

Problem with your Podfile is that you are trying to add the pods in the Tests target and not to actual project target. After changing the file as above install the Pods again and then run the project even if you get "No such module error" because it might happen for the first time.

Solution 2

You are inserting the pods in the tests target, not in the project target.

To solve this problem move the pods to the project target as below:

# 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
Share:
14,689
Jing Bian
Author by

Jing Bian

Updated on June 06, 2022

Comments

  • Jing Bian
    Jing Bian almost 2 years

    I try to use RxSwift in my project. My podfile looks like below, ↓

    Enter image description here

    I got this error:

    Enter image description here

    This is my Link Binary With Libraries status:

    Enter image description here

    I have tried to fix it for over three hours. But the answers on the site don't work for me...

  • Jing Bian
    Jing Bian over 7 years
    i made a stupid mistake! sorry...
  • Karl-John Chow
    Karl-John Chow over 3 years
    inherit! :search_paths did the trick for me! Thank you!