2017年04月05日

[iOS] CocoaPod で GoogleAnalyticsを追加した後でエラー「_OBJC_CLASS_$_GGLContext」

CocoaPod を使って手順通りにGoogleAnalyticsのSDKをプロジェクトに
追加したはずなのにビルドエラーになりハマったのでメモ。

Google Analyticsの導入手順
https://developers.google.com/analytics/devguides/collection/ios/v3/?hl=ja

エラー:
_OBJC_CLASS_$_GGLContext

原因は、手順にあるこのプログラムの部分。

NSError *configureError;
[[GGLContext sharedInstance] configureWithError:&configureError];

どうも「GGLContext」が見つからないようでした。

解決策は、
Xcode の Build Setting で OTHER_LDFLAGS で検索し、Other Linker Flags に
$(inherited)
を追記することでした。

スクショ20170405.png

参考:
http://stackoverflow.com/questions/31108868/undefined-symbols-for-architecture-armv7-objc-class-gglcontext-referenced

pod install コマンドを実行した後に、そんなメッセージ出てたわー。
--------------------
[!] The `プロジェクト名 [Release]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-プロジェクト名/Pods-プロジェクト名.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
--------------------
posted by be-style at 00:16| Comment(0) | iOS
この記事へのコメント
コメントを書く
お名前:

メールアドレス:

ホームページアドレス:

コメント: [必須入力]

※ブログオーナーが承認したコメントのみ表示されます。