Google Analytics Library IOS

前端 未结 11 1640
逝去的感伤
逝去的感伤 2021-02-12 17:39

When i add google analytics library, i have this warning

Undefined symbols for architecture armv7:
  \"_OBJC_CLASS_$_NSAttributeDescription\", referenced from:
          


        
相关标签:
11条回答
  • 2021-02-12 18:17

    Add libGoogleAnalytics.a to your target setting [Build phases]-[Link Binary with Libraries]. Also check if libsqlite3.0dylib (where GA stores tracking data) and CFNetwork.framework are added there as they are required for Google Analytics/iOS (version 2.0 beta 3).

    P.S. For Google Analytics/iOS version 3.0 CoreData framework is required instead.

    0 讨论(0)
  • 2021-02-12 18:19

    Had similar issue after migrating to SDK 2.0 beta 4. Resolved by removing old GA library path from My Build Settings > Library Search Paths as pointed by Adri.

    0 讨论(0)
  • 2021-02-12 18:21

    I had have the same issue on NSAttributeDescription. In documentation this function is from CoreData.framework, so I have added this framework and no more errors on that issue.

    0 讨论(0)
  • 2021-02-12 18:25

    Problem related to Google Analytics SDK for iOS v2 migration.

    I am not sure which topic to write it to as there is no exact problem--I've bumped into and solved by my own--found (this one seems to be the closest (not sure if I should open a new one)), but might be helpfull for someone.

    Problem:

    I have my previous (1.5.1) SDK installed in "SDKs/GoogleAnalytics SDK" separate folder. On v2 migration I've placed the new files into "SDKs/GoogleAnalytics SDK v2". After following all the instructions about migration (from Google site) (and, in details, that was just removing the previous references to the files from the first folder and adding the new ones from the new one), I started to get the following error message on compilation:

    Undefined symbols for architecture armv7: "_OBJC_CLASS_$_GAI", referenced from: objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

    I went trough first pages of googling (and stackoverflowing) and the most popular solution suggested was "to set 'Build active architecture only' property to 'YES'" (my active architectures are "armv7 armv7s"). But that DID NOT HELP at all.

    Solution:

    However, a miracle happened. I've noticed that there is an old directory "SDKs/GoogleAnalytics SDK" was listed in linker pathes. So, after that directory removing (as I don't know where the list of the directories exists in settings) everything started to compile and work like a charm (also setting 'Build active architecture only' to 'YES' was not necessary for me).

    0 讨论(0)
  • 2021-02-12 18:31

    I was having this issue because i didn't add the libGoogleAnalytics_debug.a file. The problem just got resolved as i added this file and built the project again.

    0 讨论(0)
提交回复
热议问题