我是 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 找不到 pod "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
。
据我所知,两个瑜伽 podspec 定义都指向同一个文件,但仍然失败。我在 google 和 stackoverflow 上进行了广泛的搜索,但找不到任何有用的东西。