Cocos2d-JsでCocoaPodsを使用する
CocoaPodsのインストールは済ませたものとする
podの初期化
frameworks/runtime-src/proj.ios_mac/ pod init
Podfileの編集
今回はParseをインストールします。
vi Podfile
# Uncomment this line to define a global platform for your project # platform :ios, '6.0' target 'Cocos2dJsBase iOS' do pod 'Parse' end target 'Cocos2dJsBase Mac' do end
pod installを実行
$ pod install Analyzing dependencies CocoaPods 0.38.0.beta.2 is available. To update use: `gem install cocoapods --pre` [!] This is a test version we'd love you to try. For more information see http://blog.cocoapods.org and the CHANGELOG for this version http://git.io/BaH8pQ. Downloading dependencies Installing Bolts (1.2.0) Installing Parse (1.7.5) Generating Pods project Integrating client project [!] Please close any current Xcode sessions and use `Cocos2dJsBase.xcworkspace` for this project from now on. [!] The platform of the target `Cocos2dJsBase iOS` (iOS 5.0) may not be compatible with `Parse (1.7.5)` which has a minimum requirement of iOS 6.0. [!] The `Cocos2dJsBase iOS [Debug]` target overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-Cocos2dJsBase iOS/Pods-Cocos2dJsBase iOS.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `Cocos2dJsBase iOS [Debug]` target overrides the `LIBRARY_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-Cocos2dJsBase iOS/Pods-Cocos2dJsBase iOS.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `Cocos2dJsBase iOS [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-Cocos2dJsBase iOS/Pods-Cocos2dJsBase iOS.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `Cocos2dJsBase iOS [Release]` target overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-Cocos2dJsBase iOS/Pods-Cocos2dJsBase iOS.release.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `Cocos2dJsBase iOS [Release]` target overrides the `LIBRARY_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-Cocos2dJsBase iOS/Pods-Cocos2dJsBase iOS.release.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `Cocos2dJsBase iOS [Release]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-Cocos2dJsBase iOS/Pods-Cocos2dJsBase iOS.release.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target.
エラーが出ているが次の項で修正する。
xcode起動
カレントディレクトリに Cocos2dJsBase.xcworkspace が作成されているので、こちらを使用してxcodeを起動
Build Settingsで
Header Search Paths
Library Search Paths
Other Linker Flags
に$(inherited)を追加
再度pod install
補足
Cocos2dJsBase.xcworkspaceに GameController.framework を手動で追加しないと動かないことがある?