如何通过cocoapods使用Google

如何通过cocoapods使用Google

本文介绍了如何通过cocoapods使用Google Analytics for iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的桥接标题中,我无限地得到< Google / Analytics.h>找不到 我遵循Google自己的教程:

Podfile:

解决方案

在这里找到一些帮助(由Matthew Bradshaw提供):



似乎cocoapods安装不正确,或者错误地设置了构建设置奇怪)。

遵循他的建议,我从头开始创建pod install'd,创建桥接标题并导入每个单独的文件(而不是< Google / Analytics。 h>),然后在桥头创建指定的构建设置!



Voila桥接头不再抱怨无法找到文件!很好!


In my bridging header, I infinitely get "<Google/Analytics.h> not found"

I followed Google's own tutorial: https://developers.google.com/analytics/devguides/collection/ios/v3/?ver=swift

I've tried the 'pod GoogleAnalytics' methods people have posted.

I've tried all of the suggestions people have posted in other threads.

Is there something else I need to change in the "build settings" ... or does 'pod install' do everything?


Bridging Header:

Build Settings:

Podfile:

解决方案

Found some help here (by Matthew Bradshaw): Use of unresolved identifier GGLContext and GAI

Seems that cocoapods incorrectly installed, or set the build settings incorrectly (or something strange).

Following his advice, I started from scratch, pod install'd, created the bridging header and imported each individual file (and not <Google/Analytics.h>), then pointed build settings at the bridging header!

Voila, the bridging header is no longer complaining about not being able to find files! Nice!

这篇关于如何通过cocoapods使用Google Analytics for iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 18:01