Use of unresolved identifier GGLContext and GAI

前端 未结 5 841
不知归路
不知归路 2021-01-03 20:00

I am having a bit of trouble. I am attempting to install Google Analytics into an app and am consistently getting the use of unresolved identifier GGLContext a

5条回答
  •  囚心锁ツ
    2021-01-03 20:29

    Well, it looks like I was able to get it squared away.

    There were several problems with all attempts on this.

    1. Cocoapods had not installed correctly. I reinstalled and then had better success importing the correct files.

    2. Doing it manually, as I posted above is not the best option.

    3. After the Cocoapods re-install and starting over from a fresh copy of my project, I was able to import Google into my AppDelegate.swift.

    Key points for those who may end up in the same boat I was in:

    • Be sure to add the correct directory for your -Bridging-Header.h. You can find this under Project - Build Settings - Swift Compiler Code Generation. Use this to easily target your header file $(SWIFT_MODULE_NAME)-Bridging-Header.h

    • In your -Bridging-Header.h, do not #import , instead import the files individually. Here is an image of the files available to be imported.

    • When in doubt, reinstall Cocoapods

    • Do not trust Google tutorials to provide the most effective instruction and utilize the many SO posts on the topic.

    I really hope this helps someone not spend 10 hours on the problem as I have.

提交回复
热议问题