2016-12-27 33 views
0

我嘗試在我的項目中使用RxSwift。我podfile看起來像下面,↓使用Xcode 8和Swift 3.0獲取「沒有這樣的模塊'RxSwift'」

Enter image description here

我得到這個錯誤:

Enter image description here

這是我鏈接二進制與圖書館狀態:

Enter image description here

我試圖解決它超過三個小時。但網站上的答案不適用於我...

+0

您只在目標'RxStudyTests'中包含兩個莢,但不包含在常規目標中,特別是不包含在目標'RxStudy'中(甚至更好:所有目標) – luk2302

回答

3

更換你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 

問題與您Podfile是您要添加的測試目標吊艙,而不是實際的項目目標。如上所述更改文件後,再次安裝Pods,然後運行該項目,即使您得到「無此類模塊錯誤」,因爲它可能是第一次發生。

3

您正在測試目標中插入窗格,而不是在項目目標中。

真正之一:

# 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 
+0

我犯了一個愚蠢的錯誤!抱歉... –

相關問題