Google Analytics libAdIdAccess.a does not contain bitcode

Google AnalyticsXcode7Bitcode

Google Analytics Problem Overview


Xcode 7 beta 3 just installed some "additional components" (now Version 7.0 beta 3 (7A152u)), and now I'm getting a compiler error:

ld: '/<abbreviated>/Vendor/Analytics/GoogleAnalytics/libAdIdAccess.a(TAGActualAdIdAccess.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)

This Google Code post is the only mention I've found for GA and bitcode.

It would be nice if I could disable it for this library only rather than disable bitcode entirely. Is that possible?

This answer provides a work around for bitcode being enabled by default, and this may ultimately be a dupe of that more generic question.

Google Analytics Solutions


Solution 1 - Google Analytics

Update:

Good news everyone!

Google Analytics now supports Bitcode with their 3.14 release. You can grab it from their download sources, however its not listed on Cocoapods yet.

Google Analytics SDK Download

Change Log

Original:

Google needs to compile their analytics SDK into a bitcode library. However, from previous experience with Google updating their libraries to 64-bit it took over half a year iirc.

My advice is if you're not supporting watchOS we can just wait it out, got to

  1. Build Settings

  2. Enable Bitcode

  3. Set to No

If you are supporting watchOS, use a different analytics tool for now.

Extra info:

There's developers talking about it on a google forum here: https://groups.google.com/forum/#!topic/ga-mobile-app-analytics/d6ML4BKBBeY

Facebook and Fabric.io (Crashlytics, TwitterKit) have already updated to use bitcode, so it technically shouldn't be too difficult for Google to follow suit. I believe this type of holdback to be politics. The ones who have the most to lose are our users.

Solution 2 - Google Analytics

Welcome back to 2013, as @david-wong mentioned, it took a year for Google to support arm64. Whenever Apple announces a change or requirement to the toolchain, it takes the Google ios SDK team years to update their static lib. Just to set your expectations, they just recently acknowledge that bitcode support is a "high priority" issue, even though app slicing/bitcode was announced on June 8th, 2015. If you're using GA in your main target, GA will prevent you from using the extremely valuable benefit of architecture slicing.

Disabling bitcode isn't a workaround, it's just disabling bitcode support. Hopefully someone managing GA sees this, and decides to makes ios a first class citizen.

Solution 3 - Google Analytics

Google have just updated the Google Analytics and Google Tag Manager SDKs (version 3.14) to support Bitcode, so you can update the libraries and compile your app using "Enable Bitcode - Yes" flag.

Download page

Direct link

Solution 4 - Google Analytics

Upgrade your GoogleAnalytics sdk using pod.

  1. Open terminal

  2. Go to your project directory

  3. pod init

  4. Open the pod file created in your project directory

  5. Write the following lines

    platform :ios, '10.0'
    
    target “GoogleAnalyticsTestApp” do
       pod 'GoogleAnalytics'
       pod 'GoogleIDFASupport'
    end
    

This will resolve the error. From the following links you can add Google's Api:

1.http://cocoapods.org/pods/GoogleAnalytics

2.http://developers.google.com/ios/guides/cocoapods

Solution 5 - Google Analytics

If you are using cocoapods, you can add this at the end of the Podfile:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ENABLE_BITCODE'] = 'NO'
        end
    end
end

This will recurse through all the pods and mark the ENABLE_BITCODE off. Naturally, you will not be able to compile for the watch / apple tv (as they require it on some versions).

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionbdalzielView Question on Stackoverflow
Solution 1 - Google AnalyticsDavid WongView Answer on Stackoverflow
Solution 2 - Google AnalyticsRyan RomanchukView Answer on Stackoverflow
Solution 3 - Google AnalyticsIgor AkimovView Answer on Stackoverflow
Solution 4 - Google AnalyticsRubaiyat Jahan MumuView Answer on Stackoverflow
Solution 5 - Google AnalyticskindaianView Answer on Stackoverflow