“找不到Google/Analytics.h文件"在将广告连播更新到GoogleAnalytics之后 [英] "Google/Analytics.h file not found" after updating pod to GoogleAnalytics

查看:131
本文介绍了“找不到Google/Analytics.h文件"在将广告连播更新到GoogleAnalytics之后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用pod

pod 'Google/Analytics'
pod 'Google/SignIn'

但是运行 pod install 后,我在Pod安装结束时收到以下警告

but after running pod install I was receiving the following warning at the end of the pod installation

[!] Google has been deprecated

我在Google中进行搜索,发现建议使用新的广告连播

I searched in Google and I found that it is suggested to use the new pods

pod 'GoogleAnalytics'
pod 'GoogleSignIn'

这将删除 pod安装警告.但是使我的构建失败,并在以下任何文件中出现以下错误:

That removes the pod install warning. But makes my build fail with the following error in any file with the line:

#import <Google/Analytics.h>                    (!error)Google/Analytics.h file not found

我该如何解决?

推荐答案

GoogleAnalytics 窗格更改了 Google/Analytics 窗格的工作方式.最重要的变化是GoogleAnalytics不使用 GoogleServices-Info.plist ,而是您应该手动设置跟踪器.此外, Google/Analytics.h 文件已不存在,您必须导入正确的文件,我为您提供一些示例.

The GoogleAnalytics pod changed a few things as how the Google/Analytics pod worked. the Most important change is that GoogleAnalytics does not use the GoogleServices-Info.plist instead you should set up the tracker manually. Also the Google/Analytics.h file no longer exist, you must import the correct file, I leave you some examples.

#import <GoogleAnalytics/GAI.h>
#import <GoogleAnalytics/GAIFields.h>
#import <GoogleAnalytics/GAILogger.h>
#import <GoogleAnalytics/GAIDictionaryBuilder.h>
#import <GoogleAnalytics/GAITrackedViewController.h>
#import <GoogleAnalytics/GAITracker.h>

有关更多信息,请参见开发指南 https://developers.google.com/analytics/devguides/collection/ios/v3/?ver = swift

For more information check the dev guide https://developers.google.com/analytics/devguides/collection/ios/v3/?ver=swift

这篇关于“找不到Google/Analytics.h文件"在将广告连播更新到GoogleAnalytics之后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆