Cocoapods iOS – 谷歌已被弃用 – 如何摆脱警告?

我做的步骤:

  1. pod repo remove master

  2. pod setup

  3. pod update --verbose (只是为了检查进度,尤其是在更新Google SDK时,花了很长时间才完成)。

在那里,我得到了警告。 在我的日志中,Google SDK成功更新:

– >安装Google 3.1.0(3.0.3)

– >安装GoogleMaps 2.3.0(是2.2.0)

Podfile:

 target 'MyProj' do ... pod 'Google/Analytics' pod 'GoogleMaps' ... target 'MyProjTests' do inherit! :search_paths end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '3.0' end end end end 

在这里输入图像说明

我想知道如何摆脱这个警告。

pod 'Google/Analytics'更改为pod 'GoogleAnalytics'删除斜杠。

扩展Paul Beusterien回答:

首先,从桥接头删除旧的导入:

 #import <Google/Analytics.h> 

然后,将下列内容添加到桥接头:

 #import "GAI.h" #import "GAIDictionaryBuilder.h" #import "GAIEcommerceFields.h" #import "GAIEcommerceProduct.h" #import "GAIEcommerceProductAction.h" #import "GAIEcommercePromotion.h" #import "GAIFields.h" #import "GAILogger.h" #import "GAITrackedViewController.h" #import "GAITracker.h" 

最后您可能需要重新检查: https : //developers.google.com/analytics/devguides/collection/ios/v3/

你不需要GGLContext行了。

希望这可以帮助。