2016-11-15 130 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文件中的第二行将帮助你。

相关问题