Xcode和Cocoapods“没有这样的模块”错误
我最近升级到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
尝试:
的Xcode - >首选项 - >地点 - > DerivedData
打开文件夹DerivedData并将其移动到回收站
取消对下一行定义一个全球性平台为您的项目
platform :iOS, '9.0'
取消注释您的pod文件中的第二行将帮助你。
@AnniS你能提供更多的细节吗?我不确定你的意思是 – Jessica
确保你已经遵循了我所拥有的https://github.com/ReactiveCocoa/ReactiveCocoa –
中提到的所有步骤,特别是考虑到与我相关的步骤总的来说, “将此行添加到您的Podfile”,这是我的。 – Jessica