iOS build fails with _sqlite3 linking issues when using Google Analytics SDK 3.0

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.

yeah, hit the same issue last year. GA SDK docs sucked back then - missing libsqlite3.dylib got everyone. link libsqlite3.dylib, not libsqlite3.0.dylib since apple deprecated the versioned one. saved me headaches during app store submission.

Good catch on the libsqlite3.0 dependency. I hit the same thing migrating an older project with Google Analytics SDK 2.x. Google Analytics needs SQLite for local storage and caching, but their early integration guides didn’t always mention this. Watch out for other third-party libraries with their own SQLite dependencies - you can get version conflicts. Also check your build settings if you’ve customized linking flags, since you might be excluding system libraries by accident. That directory warning usually means your framework search paths need tweaking, but adding libsqlite3.0 was definitely the fix you needed.