过去几天里,我一直在用这种方式将我的头撞在墙上,但尽管有多个Google/SO/Github搜索,我无法找到解决我遇到的问题的解决方案!使用Cocoapods进行Xcode单元测试
我想要做的是为我的应用程序创建一些单元测试,它使用Firebase窗格。
我正在使用Xcode 7.3.1 & Cocoapods 1.0.1。 更新:问题仍然在Xcode 8.0
有了这个podfile:
platform :ios, '9.0'
use_frameworks!
inhibit_all_warnings!
target 'MyApp' do
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
target 'MyAppTests' do
inherit! :search_paths
end
end
在我XCTest类我得到
Missing required module 'Firebase'
误差在@testable import MyApp
或者:
platform :ios, '9.0'
use_frameworks!
inhibit_all_warnings!
def common_pods
pod 'SwiftyTimer'
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
end
target 'MyApp' do
common_pods
end
target 'MyAppTests' do
common_pods
end
个
测试建立,但我的控制台上不乏警告例如: -
Class <-FirebaseClassName-> is implemented in both ...MyApp... and ...MyAppTests... One of the two will be used. Which one is undefined
我当时只使用Firebase Analytics。在转向Google分析之后,所有事情都像魅力一样。 – marosoaie
我还没有尝试过他自己,但我可能会尝试手动添加Firebase而不使用可可豆荚:https://firebase.google.com/docs/ios/setup#frameworks – Jonny