LoginSignup
7
6

More than 5 years have passed since last update.

Bitcode対応版Google Analytics SDKをCocoapodsで入れる方法

Last updated at Posted at 2015-11-10

バージョン3.13以前のGoogleAnalytics SDKを使うプロジェクトをXCode7でコンパイルすると、bitcodeでどうのこうのというエラーが発生する。
エラーメッセージ
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)

どうやらGoogleAnalytics SDKがApple様の新機能bitcodeに対応していないから怒られた。XCodeの設定でBitcodeを無効にできる。しかい、watchOS、tvOSアプリのビルドには必須である。
Google先生がいやいやしながらも2015年10月23日にbitcode対応版Ver.3.14をリリースしたが、11月10日時点でまだCocoapodsに反映していないようである。

対策

いろいろググったら、podspecを自前で作成して対応させた達人devxoulさんを見つけた。対応方法を説明させてください。

  1. 3.14版に対応したGoogleAnalytics.podspecをダウンロードして、Podfileと同じディレクトリに保存してください。
  2. PodfileのGoogleAnalyticsのとろこを下記のように変更する。
    pod 'GoogleAnalytics', :podspec => 'GoogleAnalytics.podspec'
  3. pod updateでライブラリを更新させる
    pod update GoogleAnalytics

これでbitcode対応版の反映が完了。

独り言

これがGoogle先生がiOS開発者に対する嫌がらせではないだろう。ないだろう。きっと。。。

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6