Google Analytics Library IOS

前端 未结 11 1753
后悔当初
后悔当初 2021-02-12 17:44

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:10

    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:15

    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:15

    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)
  • 2021-02-12 18:16

    I had similar errors as above, actually more (SDK 2.0 beta 4). After adding the Analytics library/headers, linking with these two frameworks solved the issues:

    CoreData.framework and SystemConfiguration.framework

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

    I followed all suggestions and I was still getting an error on XCODE 5.1.1.

    For me the error was in target > Build Setting > Architecture > Architectures.

    I replaced the value with ARCHS_STANDARD_32_BIT and the error was gone.

    Maybe the libGoogleAnalytics lib was not compiled for 64 BIT architecture.

    Hope this will help someone. Or get latest lib which is compiled for 64 Bit.

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

    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)
提交回复
热议问题