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
パラメータにスペースが入っていたため削除。
- これはpodspecの
ERROR | [iOS] [xcodebuild] xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
- これは以下のコマンドを打ち込んで解決。
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
- 参考:http://stackoverflow.com/questions/17980759/xcode-select-active-developer-directory-error-on-osx-mavericks
- これは以下のコマンドを打ち込んで解決。
おそらく2番目のエラーに起因すると思うが、Undefined symbols for architecture i386: "_OBJC_CLASS_
というエラーがコンパイル時に消えない場合はpod spec lint
で確認すると良さそう。
このlinker errorに数週間悩まされていたので解決してよかった。。
今回、Nend SDKをcocoapods化したのでその際に見ていたサイトもリンクしておく。