I’m trying to add Google Analytics SDK 3.0 to my iOS app but keep running into linking problems during the build process.
I followed the setup guide and added all the required frameworks to my project:
- libGoogleAnalyticsServices.a
- AdSupport.framework
- CoreData.framework
- SystemConfiguration.framework
- libz.dylib
But when I compile my app, I still get these sqlite3 related errors:
ld: warning: directory not found for option '-L"/Users/....MyApp/Frameworks/GoogleAnalytics"'
"_sqlite3_bind_text", referenced from:
-[GAIDataStorePersistentImpl saveDataToDatabase:timestamp:] in libGoogleAnalyticsServices.a(GAIDataStorePersistentImpl.o)
"_sqlite3_bind_double", referenced from:
-[GAIDataStorePersistentImpl removeRecords:] in libGoogleAnalyticsServices.a(GAIDataStorePersistentImpl.o)
"_sqlite3_bind_int64", referenced from:
-[GAIDataStorePersistentImpl saveDataToDatabase:timestamp:] in libGoogleAnalyticsServices.a(GAIDataStorePersistentImpl.o)
-[GAIDataStorePersistentImpl fetchRecordIds:] in libGoogleAnalyticsServices.a(GAIDataStorePersistentImpl.o)
....
What could be the reason for these linking failures? Did I forget to include something important?
Any suggestions would be great.
UPDATE:
I fixed this by adding the libsqlite3.0 library to my project. The official documentation didn’t mention this dependency. This should help others facing the same issue.