私は CocoaPods を初めて使用し、MS AppCenter で RN プロジェクトを構築しようとしています。私Podfile
の見た目はかなりシンプルです:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'recommendapp' do
rn_path = '../node_modules/react-native'
rn_maps_path = '../node_modules/react-native-maps'
# See http://facebook.github.io/react-native/docs/integration-with-existing-apps.html#configuring-cocoapods-dependencies
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga/yoga.podspec'
pod 'React', :path => '../node_modules/react-native', subspecs: [
'Core',
'CxxBridge',
'DevSupport',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket',
]
# React Native third party dependencies podspecs
pod 'DoubleConversion', :podspec => "#{rn_path}/third-party-podspecs/DoubleConversion.podspec"
pod 'glog', :podspec => "#{rn_path}/third-party-podspecs/glog.podspec"
pod 'Folly', :podspec => "#{rn_path}/third-party-podspecs/Folly.podspec"
# react-native-maps dependencies
pod 'react-native-maps', path: rn_maps_path
pod 'react-native-google-maps', path: rn_maps_path # Remove this line if you don't want to support GoogleMaps on iOS
pod 'GoogleMaps' # Remove this line if you don't want to support GoogleMaps on iOS
pod 'Google-Maps-iOS-Utils' # Remove this line if you don't want to support GoogleMaps on iOS
# Pods for AppCenter
pod 'AppCenter/Crashes', '~> 1.6.0'
pod 'AppCenter/Analytics', '~> 1.6.0'
pod 'AppCenterReactNativeShared', '~> 1.5.0'
platform :ios, '9.0'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'react-native-google-maps'
target.build_configurations.each do |config|
config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
end
end
if target.name == "React"
target.remove_from_project
end
end
end
ただし、ビルドをトリガーすると失敗します
[!] CocoaPods はポッド "yoga" の互換性のあるバージョンを見つけられませんでした: スナップショット (Podfile.lock): yoga (from ../node_modules/react-native/ReactCommon/yoga/yoga.podspec
)
Podfile: ヨガ (から../node_modules/react-native/ReactCommon/yoga/yoga.podspec
)
以前のナイーブな CocoaPods リゾルバが原因で、プレリリース バージョンyoga
を明示的に要求せずに のプレリリース バージョンを使用していたため、競合が発生しています。バージョン要件を Podfile (例: ) に追加してプレリリース バージョンを使用するか、 をpod 'yoga', '= 0.54.2.React'
実行して安定したバージョンに戻すかを決定してくださいpod update yoga
。
私が見る限り、両方の yoga podspec 定義は同じファイルを指していますが、それでも失敗します。Google と stackoverflow で広範な検索を実行しましたが、役立つものは何も見つかりませんでした。