我在使用 Cocoapods 和 Xcode 7 beta 6 时遇到问题:我有一个包含三个不同测试目标(测试、UITests、IntegrationTests)的项目。我的 pod 似乎在第一个目标(“测试”)上工作得很好,但其他目标有问题:
- 如果我不引用后两个目标中的任何 Cocoapods,一切都构建得很好。
- 但是,当我尝试使用其中一个 pod(在本例中为 XCGLogger)时,会出现链接器错误。
- 我检查了构建阶段,发现
Embed Pods Frameworks
两个目标都缺少它,所以我手动添加了它。 - 这样做并清理,删除派生数据后,问题仍然存在。
附上显示链接器错误的屏幕截图。同样,只有在我尝试在后两个目标中使用 XCGLogger 时才会发生这种情况。它在第一个目标中运行良好。
只是为了彻底......这是我正在使用的 Podfile:
platform :ios, "8.0"
use_frameworks!
target 'Glimpulse' do
pod "SwiftSpinner", :git => 'https://github.com/zbeckman/SwiftSpinner.git'
pod 'XCGLogger', :git => 'https://github.com/DaveWoodCom/XCGLogger.git', :branch => 'swift_2.0'
pod 'GRValidation', '~> 0.2'
end
target 'GlimpulseTests' do
pod "SwiftSpinner", :git => 'https://github.com/zbeckman/SwiftSpinner.git'
pod 'XCGLogger', :git => 'https://github.com/DaveWoodCom/XCGLogger.git', :branch => 'swift_2.0'
pod "Nimble", :git => 'https://github.com/Quick/Nimble.git', :branch => 'swift-2.0'
pod "Quick", :git => 'https://github.com/zbeckman/Quick.git', :branch => 'swift-2.0'
pod 'GRValidation', '~> 0.2'
# pod "SwiftCheck", :git => 'https://github.com/zbeckman/SwiftCheck.git', :branch => 'swift-develop'
end
target 'GlimpulseUITests' do
pod "SwiftSpinner", :git => 'https://github.com/zbeckman/SwiftSpinner.git'
pod 'XCGLogger', :git => 'https://github.com/DaveWoodCom/XCGLogger.git', :branch => 'swift_2.0'
pod "Nimble", :git => 'https://github.com/Quick/Nimble.git', :branch => 'swift-2.0'
pod "Quick", :git => 'https://github.com/zbeckman/Quick.git', :branch => 'swift-2.0'
pod 'GRValidation', '~> 0.2'
# pod "SwiftCheck", :git => 'https://github.com/zbeckman/SwiftCheck.git', :branch => 'swift-develop'
end
target 'GlimpulseIntegrationTests' do
pod "SwiftSpinner", :git => 'https://github.com/zbeckman/SwiftSpinner.git'
pod 'XCGLogger', :git => 'https://github.com/DaveWoodCom/XCGLogger.git', :branch => 'swift_2.0'
pod "Nimble", :git => 'https://github.com/Quick/Nimble.git', :branch => 'swift-2.0'
pod "Quick", :git => 'https://github.com/zbeckman/Quick.git', :branch => 'swift-2.0'
pod 'GRValidation', '~> 0.2'
# pod "SwiftCheck", :git => 'https://github.com/zbeckman/SwiftCheck.git', :branch => 'swift-develop'
end
link_with 'GlimpulseUITests'
link_with 'GlimpulseIntegrationTests'