tech::hexagram

personal note for technical issue.

Xcode6でオレオレライブラリをCocoapods経由で入れるときの注意事項

OSはMavericks。

pod spec lintでエラーが出ていないか確認する

$ pod spec lint targetfile.podspec

これを実行した際に、ERRORが出ている部分は修正する必要がある。自分は以下のエラーが出ていたので修正した。

Loading subst-jis...done
                    file.
    - ERROR | [name] The name of a spec should not contain whitespace.
    - WARN  | [source] Git sources should specify a tag.
    - ERROR | [iOS] [xcodebuild]  xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
    - WARN  | [iOS] Unable to find a license file

Analyzed 1 podspec.
  • ERROR | [name] The name of a spec should not contain whitespace.

    • これはpodspecのnameパラメータにスペースが入っていたため削除。
  • ERROR | [iOS] [xcodebuild] xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

おそらく2番目のエラーに起因すると思うが、Undefined symbols for architecture i386: "_OBJC_CLASS_ というエラーがコンパイル時に消えない場合はpod spec lintで確認すると良さそう。

このlinker errorに数週間悩まされていたので解決してよかった。。

今回、Nend SDKをcocoapods化したのでその際に見ていたサイトもリンクしておく。