我最近升級到Xcode 8和一個現有的項目Swift 3.在與Cocoapods有各種問題後,我決定從頭開始。在運行pod deintegrate
和刪除Podfile
,Podfile.lock
和[Project].xcworkspace
後,就Cocoapods而言,我有一個空白的板岩。Xcode和Cocoapods「沒有這樣的模塊」錯誤
然後我採取了以下措施:
開盤項目位置的終端跑
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
是成功的。
關閉Xcode,將我使用的模塊添加到Podfile(請參閱下文),再次運行
pod install
。根據終端輸出,這是成功的。打開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
@AnniS你能提供更多的細節嗎?我不確定你的意思是 – Jessica
確保你已經遵循了我所擁有的https://github.com/ReactiveCocoa/ReactiveCocoa –
中提到的所有步驟,特別是考慮到與我相關的步驟總的來說, 「將此行添加到您的Podfile」,這是我的。 – Jessica