4

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...

1
  • You are only including the two pods in the target RxStudyTests, but not in the regular targets, especially not in the target RxStudy (or even better: all targets)
    – luk2302
    Commented Dec 27, 2016 at 15:21

2 Answers 2

12

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.

10

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
2
  • 1
    i made a stupid mistake! sorry...
    – Jing Bian
    Commented Dec 28, 2016 at 2:26
  • 1
    inherit! :search_paths did the trick for me! Thank you! Commented Dec 6, 2020 at 12:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.