Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Analytics doesn't work on new iOS project

Tags:

I have created a new iOS project and added Google Analytics support following by official instructions.

I've added to Frameworks:

libGoogleAnalyticsServices.a AdSupport.framework CoreData.framework SystemConfiguration.framework libz.dylib 

But it doesn't work with the errors:

ld: warning: directory not found for option '-L/Users/.../Sources/GoogleAnalytics' Undefined symbols for architecture armv7:   "_OBJC_CLASS_$_NSManagedObjectModel", referenced from:       objc-class-ref in libGoogleAnalyticsServices.a(GAICoreDataUtil.o)   "_OBJC_CLASS_$_NSAttributeDescription", referenced from:       objc-class-ref in libGoogleAnalyticsServices.a(GAICoreDataUtil.o)   "_OBJC_CLASS_$_NSEntityDescription", referenced from:       objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o)       objc-class-ref in libGoogleAnalyticsServices.a(GAICoreDataUtil.o)   "_OBJC_CLASS_$_NSPersistentStoreCoordinator", referenced from:       objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o)   "_OBJC_CLASS_$_NSFetchRequest", referenced from:       objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o)   "_OBJC_CLASS_$_NSManagedObjectContext", referenced from:       objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o)   "_NSSQLiteErrorDomain", referenced from:       -[GAIDataStore performBlockAndWait:withError:] in libGoogleAnalyticsServices.a(GAIDataStore.o)   "_NSSQLiteStoreType", referenced from:       -[GAIDataStore coordinatorWithModel:URL:] in libGoogleAnalyticsServices.a(GAIDataStore.o)   "_NSOverwriteMergePolicy", referenced from:       -[GAIDataStore contextWithModel:URL:] in libGoogleAnalyticsServices.a(GAIDataStore.o) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) 

How can I fix it? And does it support arm64?

like image 950
Dmitry Avatar asked Feb 25 '14 08:02

Dmitry


People also ask

Is Google Analytics affected by iOS update?

Apple's iOS 15 is the latest operating system update that includes more privacy features, which will impact Google Analytics and marketers in some notable ways. These changes are part of Apple's ongoing commitment to data privacy.

Does iOS 14 block Google Analytics?

As more information has surfaced, it appears that Intelligent Tracking Prevention (ITP) in Safari 14 is not completely blocking Google Analytics. Instead, it's blocking third-party tracking cookies and cross-site scripting requests, which limits portions of Google Analytics.

Is Apple blocking Google Analytics?

Google Analytics still functions as an analytics platform, but you can't use it for retargeting and other features where you need cross-website tracking. Safari does not block Google Analytics. However, Apple's “Privacy Report” started a privacy trend that is getting more and more steam.

Does Google Analytics work on iOS?

Use our iOS sample app to see how Analytics works, or add Analytics to your existing app. To use this sample, make sure you have Xcode and CocoaPods.


2 Answers

From Google Analytics developer page

The Google Analytics SDK uses the CoreData and SystemConfiguration frameworks, so you will need to add the following to your application target's linked libraries:

  • libGoogleAnalyticsServices.a
  • AdSupport.framework
  • CoreData.framework
  • SystemConfiguration.framework
  • libz.dylib

Looks like you are missing out CoreData.framework.


Running the lipo -info command on the GA library.

xcrun -sdk iphoneos lipo -info libGoogleAnalyticsServices.a 

Gives result,

Architectures in the fat file: libGoogleAnalyticsServices.a are: armv7 armv7s i386 x86_64 arm64  

So it does support arm64.

Hope that helps!

like image 140
Amar Avatar answered Jan 05 '23 10:01

Amar


Thanks for all! The following steps helped me:

  1. Remove CoreData.framework.
  2. Add again CoreData.framework.

arm64 is now supported. Thanks to Amar.

Now I should fix the last warning:

ld: warning: directory not found for option '-L/Users/.../Sources/GoogleAnalytics' 

It happens because I work with the project on different users.

like image 31
Dmitry Avatar answered Jan 05 '23 09:01

Dmitry