Google/Analytics.h file not found when adding to AppDelegate

前端 未结 8 1620
迷失自我
迷失自我 2020-12-30 04:06

I am trying to integrate Google Analytics in my ios project using Cocoapods. However, after following this for the steps till adding configuration file to my project, when i

8条回答
  •  没有蜡笔的小新
    2020-12-30 04:59

    Problems

    1. The code examples on the official documentation suggest installing 1.0.0. Which doesn't even have binaries compiled for arm64.
    2. There seem to be at least three separate pods related to GA. GoogleAnalytics-iOS-SDK, GoogleAnalytics, Google/Analytics.

    Solution

    Add this to your Podfile: pod 'Google/Analytics' and then pod install.

    That should work. Now you can simply import Google/Analytics.h as suggested in the docs:

    #import

    Further Discussion

    There were two sets of issues that I ran into:

    1. When using the incorrect suggested pod version (1.0.0), was a 64-bit compatibility issue. (ld: symbol(s) not found for architecture arm64)

    2. When using the other pods (GoogleAnalytics-iOS-SDK and GoogleAnalytics) I had complaints of a missing header file. ("Google/Analytics.h" not found)

    I found this gentleman's post on a mailing list which suggested the Google/Analytics pod with no version number. (pod 'Google/Analytics' as noted above.)

提交回复
热议问题