GoogleAnalyticsを組み込んだiOSアプリがiOS9実機ビルドできなかった

表題の通りGoogleAnalyticsを組み込んだiOSアプリのiOS9実機ビルドでエラーが出た。 とりあえず何も考えないでGoogleAnalyticsを最新版に更新したが変わらなかった。iOS9対応というかXcode7対応。

https://developers.google.com/analytics/devguides/collection/ios/v3/sdk-download?hl=ja

エラー内容

ld: '/Users/xxxx/path/to/app/Libs/GoogleAnalytics/libGoogleAnalyticsServices.a(TAGDataProvider.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 arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

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 arm64

解決策としてはEnable Bitcodeの値をNO変更する。

Activating this setting indicates that the target or project should generate bitcode during compilation for platforms and architectures which support it.  For Archive builds, bitcode will be generated in the linked binary for submission to the app store.  For other builds, the compiler and linker will check whether the code complies with the requirements for bitcode generation, but will not generate actual bitcode. [ENABLE_BITCODE]

ENABLE_BITCODEはストアに公開されたアプリをCPUアーキテクチャに適した形にAppleがバイナリを生成しなおすことを良しとする&生成しなおすことができるか、を判断するための設定らしい。シミュレータビルドのときはチェック処理が走らないようなのでエラーは起きない。

参考
http://qiita.com/usagimaru/items/cb19f283db4ac0cd8bd6#bitcode
http://qiita.com/gamako/items/f37dbb05de9d3832ce6b