過去幾天裏,我一直在用這種方式將我的頭撞在牆上,但儘管有多個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