gpt4 book ai didi

ios - 如何摆脱 "CocoaPods could not find compatible versions for pod"?我尝试更新 cocoapod 和 pod repo

转载 作者:行者123 更新时间:2023-12-04 13:54:30 27 4
gpt4 key购买 nike

在我的 react-native 项目中,我想更新我的所有依赖项,所以我运行以下命令:
1.要更新所有软件包的新主要版本,请全局安装 npm-check-updates 软件包:

npm install -g npm-check-updates
  • 升级 package.json 文件中的所有版本提示:ncu -u
  • 运行更新:npm update

  • 我查了 package.jsonpackage-lock.jso n,依赖已更新到最新版本。
    然后,我 cdios/文件夹,然后运行 ​​ pod install ,但是我收到以下错误:
    enter image description here
    是的,我在错误消息中看到它建议运行 pod repo update , 我做到了:
    enter image description here
    我也跑 sudo gem install cocoapods ,并再次尝试 pod install但我仍然遇到同样的错误。
    我的 React-Native 版本是 0.63.3
    我的播客文件:
    platform :ios, '9.0'
    require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

    def add_flipper_pods!(versions = {})
    versions['Flipper'] ||= '~> 0.33.1'
    versions['DoubleConversion'] ||= '1.1.7'
    versions['Flipper-Folly'] ||= '~> 2.1'
    versions['Flipper-Glog'] ||= '0.3.6'
    versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
    versions['Flipper-RSocket'] ||= '~> 1.0'

    pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'
    pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'
    pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
    pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'
    pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'

    # List all transitive dependencies for FlipperKit pods
    # to avoid them being linked in Release builds
    pod 'Flipper', versions['Flipper'], :configuration => 'Debug'
    pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug'
    pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug'
    pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'
    pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'
    pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'
    pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'
    pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug'
    pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'
    pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'
    pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'
    pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'
    pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'
    pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
    end

    # Post Install processing for Flipper
    def flipper_post_install(installer)
    installer.pods_project.targets.each do |target|
    if target.name == 'YogaKit'
    target.build_configurations.each do |config|
    config.build_settings['SWIFT_VERSION'] = '4.1'
    end
    end
    end
    end

    target 'MyApp' do
    # Pods for MyApp
    pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
    pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/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 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
    pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
    pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true

    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 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

    target 'MyAppTests' do
    inherit! :complete
    # Pods for testing
    end

    use_native_modules!

    # Enables Flipper.
    #
    # Note that if you have use_frameworks! enabled, Flipper will not work and
    # you should disable these next few lines.
    add_flipper_pods!
    post_install do |installer|
    flipper_post_install(installer)
    end
    end

    target 'MyApp-tvOS' do
    # Pods for MyApp-tvOS

    target 'MyApp-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
    end
    end
    如何摆脱错误?
    (我还检查了 Xcode 命令行工具:
    enter image description here
    )

    最佳答案

    对于 xcode 13 和 react-native 0.66,唯一对我有用的解决方案是:

     react-native start --reset-cache
    rm -rf node_modules/
    rm -rf package-lock.json
    cd ios && pod deintegrate
    cd .. && rm -rf ios/Podfile.lock
    npm install
    npm audit fix
    react-native link
    cd ios && pod install
    cd .. && react-native run-ios
    来源: https://github.com/facebook/react-native/issues/28408

    关于ios - 如何摆脱 "CocoaPods could not find compatible versions for pod"?我尝试更新 cocoapod 和 pod repo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65036163/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com