17

Using Xcode7. When I run my app on the simulator I get no errors. When I try to run on a real device I get this:

ld: 'Test-IOS/Pods/Google/Libraries/libGGLAnalytics.a(GGLContext+Analytics.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

How do I resolve this error?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Michael
  • 32,527
  • 49
  • 210
  • 370
  • getting the same error... had any luck ? – Ashwani Sep 21 '15 at 04:57
  • This has the same cause as [Google Analytics libAdIdAccess.a does not contain bitcode](http://stackoverflow.com/questions/31395260/google-analytics-libadidaccess-a-does-not-contain-bitcode) – Cristik Jan 12 '16 at 15:52

2 Answers2

24

The issue is that Google Analytics for iOS doesn't have support for bitcode right now. Here's the issue on Google Code:

https://code.google.com/p/analytics-issues/issues/detail?id=671

The workaround currently is to disable bitcode for your project. In your project file in the Build Settings tab under Build Options set the Enable Bitcode flag to false.

Bitcode Flag

Note that if you disable it completely you won't be able to build for watchOS. There seems to be a way to also only disable it for iOS but then you won't be able to use analytics on watchOS.

Florian Gutmann
  • 2,666
  • 2
  • 20
  • 28
1

This is resolved by Google. If you follow the Google Issue further down (https://code.google.com/p/analytics-issues/issues/detail?id=671), you'll see the solution is to update to Google Analytics 3.14 SDK which includes bitcode support.

If you use CocoaPods, note the pod name is a little unintuitive. If you ONLY use Google Analytics, you'll want:

pod 'GoogleAnalytics'

NOT -> pod 'Google/Analytics'

If you use more than Analytics, you will need the second entry BUT I believe there might still not be Bitcode support for the "Google/Analytics" library.

I can confirm though, that if you only need Analytics, the above does work. I'm on Xcode 7.2, BTW.

EricWasTaken
  • 1,654
  • 14
  • 19