Chr*_*ley 8 unit-testing google-analytics swift xcode7
我包括BridgingHeader.h但是在导入Google/Analytics.h时无法找到该文件.
这在应用程序中工作正常,它只会在测试时抛出错误.
不确定问题是什么,所以任何见解都会非常感激.
我遇到了类似的问题,并通过打开podfile并将其修改如图所示,将Google Analytics pod添加到测试和uitests目标中来修复它:
target 'MyApp' do
pod 'Google/Analytics'
end
target 'MyAppTests' do
pod 'Google/Analytics'
end
target 'MyAppUITests' do
pod 'Google/Analytics'
end
Run Code Online (Sandbox Code Playgroud)
一旦完成,我必须运行pod install
两次然后才能工作.
花了将近2个小时进行搜索,终于找到了解决所有疯狂问题的正确方法!上面接受的解决方案正在工作,但是给出了很多Class GAIUtil is implemented in both...
警告,这并不完全正确。
您需要使用cocoapods 1.0.0.beta6 +
您的测试目标应在Podfile中定义为下一个:
target 'App' do
pod 'GoogleAnalytics' , '~> 3.0'
# your other pods
target 'AppTests' do
inherit! :search_paths
# your other testing pods/frameworks
end
end
Run Code Online (Sandbox Code Playgroud)
做pod update
。
在那里找到的所有东西https://github.com/CocoaPods/CocoaPods/issues/4626#issuecomment-210402349
归档时间: |
|
查看次数: |
1852 次 |
最近记录: |