2016-11-15 56 views
6

我最近升級到Xcode 8和一個現有的項目Swift 3.在與Cocoapods有各種問題後,我決定從頭開始。在運行pod deintegrate和刪除PodfilePodfile.lock[Project].xcworkspace後,就Cocoapods而言,我有一個空白的板岩。Xcode和Cocoapods「沒有這樣的模塊」錯誤

然後我採取了以下措施:

  1. 開盤項目位置的終端跑pod init,然後pod install(使用存根Podfile是pod init創建)。

    這顯然是成功的,但有以下兩個警告傳來:

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

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

在這一點上,打開Xcode和建設項目給出了「沒有這樣的模塊「錯誤,這是完全可以預料的。

按照this question的說明解決了這個問題,重新運行pod install是成功的。

  1. 關閉Xcode,將我使用的模塊添加到Podfile(請參閱下文),再次運行pod install。根據終端輸出,這是成功的。

  2. 打開Xcode並構建項目。我再次收到「沒有這樣的模塊」的錯誤,特別是No such module 'ReactiveCocoa'

    我已經證實,與SnapKit,色調,KMPlaceholderTextView,KeychainSwift和警報器出現同樣的問題,這取決於import語句的順序。出於某種原因,Google模塊都不受此問題的影響。

我Podfile:

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

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

    # Pods for Xena 
    pod 'ReactiveCocoa', :git => 'https://github.com/ReactiveCocoa/ReactiveCocoa.git' 
    pod 'SnapKit', '~> 3.0.2' 
    pod 'Hue', '~> 2.0.1' 
    pod 'KMPlaceholderTextView', '~> 1.3.0' 
    pod 'GooglePlacePicker' 
    pod 'GooglePlaces' 
    pod 'GoogleMaps' 
    pod 'KeychainSwift', '~> 7.0' 
    pod 'Siren' 

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

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

end 
+0

@AnniS你能提供更多的細節嗎?我不確定你的意思是 – Jessica

+0

確保你已經遵循了我所擁有的https://github.com/ReactiveCocoa/ReactiveCocoa –

+1

中提到的所有步驟,特別是考慮到與我相關的步驟總的來說, 「將此行添加到您的Podfile」,這是我的。 – Jessica

回答

8

確保您打開.xcworkspace,而不是.xcodeproj文件。

您可以進一步查看此post

另請參見:目標>常規>鏈接框架和庫 確保您的框架在那裏。即使Pods_Xena.framework

+1

是的,我總是使用'.xcworkspace'。在鏈接框架和庫下我有兩個條目:'CoreData.framework'和'Pods_Xena.framework' – Jessica

+0

也添加其他框架,您可能需要將它們拖到那裏。這是他們不工作的原因。我遇到過同樣的問題。 – Munahil

+1

我已經添加了所有這些,並且仍然有相同的錯誤 – Jessica

4

嘗試:

的Xcode - >首選項 - >地點 - > DerivedData

打開文件夾DerivedData並將其移動到回收站

0

取消對下一行定義一個全球性平臺爲您的項目

platform :iOS, '9.0' 

取消註釋您的pod文件中的第二行將幫助你。

相關問題