'Linker command failed with exit code 1' when using Google Analytics via CocoaPods 'Linker command failed with exit code 1' when using Google Analytics via CocoaPods swift swift

'Linker command failed with exit code 1' when using Google Analytics via CocoaPods


Go to your build settings and switch the target's settings to ENABLE_BITCODE = YES for now.


I had this same issue. Fortunately you can use Google Analytics with BitCode enabled, but it's a bit confusing due to how Google had set up their CocoaPods support.

There's actually 2 CocoaPods you can use:

  • 'Google/Analytics'
  • 'GoogleAnalytics'

The first one is the "latest" but it's tied to the greater Google pods so it does not support Bitcode. The second one is for Analytics only and does support BitCode. However because the latter does not include extra Google pods some of the instructions on how to set it up are incorrect.

You have to use the v2 method of setting up analytics:

// Inside AppDelegate:// Optional: automatically send uncaught exceptions to Google Analytics.GAI.sharedInstance().trackUncaughtExceptions = true// Optional: set Google Analytics dispatch interval to e.g. 20 seconds.GAI.sharedInstance().dispatchInterval = 20// Create tracker instance.let tracker = GAI.sharedInstance().trackerWithTrackingId("XX-XXXXXXXX-Y")

The rest of the Google analytics api you can use the v3 documentation (you don't need to use v2).

The 'Google/Analytics' cocoapod as of this writing still does not support BitCode. See here


Had this issue, but it wasn't related to the bitcode setting. I had somehow ended up with duplicate framework files in the Frameworks folder of my XCode project. I deleted all frameworks files that were red (and duplicates). This solved the "Apple Mach O, Linker Command failed with exit code 1" error.