owi*_*wio 8 xcode cocoapods react-native
正如我的问题标题中提到的,我尝试pod install在 React Native 0.66 更新后运行,但不断收到以下错误:
[!] CocoaPods could not find compatible versions for pod "boost":
In Podfile:
RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) was resolved to 2021.06.28.00-v2, which depends on
boost
React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) was resolved to 0.66.0, which depends on
boost (= 1.76.0)
Specs satisfying the `boost (= 1.76.0), boost` dependency were found, but they required a higher minimum deployment target.
Run Code Online (Sandbox Code Playgroud)
我到处搜索了另一个引用“boost”的问题,但我在任何地方都找不到它。我已经安装boost-for-react-native并添加到我的 Podfile 中,但它似乎没有修复任何问题。
如果我将 Podfile 中的部署目标更改为11.0或14.0,我仍然会收到错误。
这完全阻止了我的项目建设,所以如果我能得到任何类型的帮助那就太好了。
完整的 Podfile 如下:
platform :ios, '11.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'manager' do
# Pods for manager
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/React/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'React-callinvoker', :path => "../node_modules/react-native/ReactCommon/callinvoker"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'RCT-Folly', :podspec => '../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec'
pod 'React-perflogger', :path => '../node_modules/react-native/ReactCommon/reactperflogger'
pod 'React-runtimeexecutor', :path => '../node_modules/react-native/ReactCommon/runtimeexecutor'
pod 'boost-for-react-native', :podspec => 'https://raw.githubusercontent.com/react-native-community/boost-for-react-native/master/boost-for-react-native.podspec'
# pod 'RNExtractColor', :path => '../node_modules/react-native-extract-color'
# pod 'react-native-webview', :path => '../node_modules/react-native-webview'
# pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
# pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
# pod 'react-native-view-shot', :path => '../node_modules/react-native-view-shot'
target 'managerTests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
end
target 'manager-tvOS' do
# Pods for manager-tvOS
target 'manager-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
post_install do |installer|
## Fix for XCode 12.5 beta
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
"_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
installer.pods_project.targets.each do |target|
# The following is needed to ensure the "archive" step works in XCode.
# It removes React & Yoga from the Pods project, as it is already included in the main project.
# Without this, you'd see errors when you archive like:
# "Multiple commands produce ... libReact.a"
# "Multiple commands produce ... libyoga.a"
targets_to_ignore = %w(React yoga)
if targets_to_ignore.include? target.name
target.remove_from_project
end
end
end
def find_and_replace(dir, findstr, replacestr)
Dir[dir].each do |name|
text = File.read(name)
replace = text.gsub(findstr,replacestr)
if text != replace
puts "Fix: " + name
File.open(name, "w") { |file| file.puts replace }
STDOUT.flush
end
end
Dir[dir + '*/'].each(&method(:find_and_replace))
end
Run Code Online (Sandbox Code Playgroud)
小智 10
当我升级到react-native 0.66.4时,我遇到了同样的问题。从字面上获取确切的错误消息。
我的 Podfile 中缺少以下行:
pod 'boost', :podspec => '../node_modules/react-native/third-party-podspecs/boost.podspec'
Run Code Online (Sandbox Code Playgroud)
添加后,我运行了pod install,问题就解决了!
| 归档时间: |
|
| 查看次数: |
7983 次 |
| 最近记录: |