【问题标题】:Cannot run pod install after updating react-native to 0.66.2将 react-native 更新到 0.66.2 后无法运行 pod install
【发布时间】:2021-12-21 22:18:39
【问题描述】:

更新到 react-native: 0.66.2 后,我在 ios 文件夹上运行 pod install 时遇到问题。运行pod install 时,cmd 触发:

Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
[!] Unable to find a specification for `React-perflogger (= 0.66.2)` depended upon by `React-Core`

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Pod 文件:

post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end

之前,我的 Podfile 包含:

pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

为了解决这个问题,一些论坛的答案改为:

pod 'RCT-Folly', :podspec => '../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec'

请帮忙,这是一个我必须尽快更新的工作项目。

我的播客文件:

platform :ios, '11.0'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
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 'AppNameHidden' do
  # Pods for AppNameHidden
  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', :modular_headers => true

  pod 'RCT-Folly', :podspec => '../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec'
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'

  use_unimodules!
  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)

  #use_flipper!({ 'Flipper' => '0.33' })
  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end

end

【问题讨论】:

  • 您尝试过更新 pod repo 吗?
  • 是的,我做到了。但没有结果。仍然有同样的问题!

标签: ios xcode react-native react-redux expo


【解决方案1】:

尝试删除 ios 文件夹中的 Pods 文件夹和 Podfile.lock 文件,然后“pod install”

【讨论】:

  • [!] 无法找到 React-logger (= 0.66.2) 依赖于 ReactCommon/turbomodule/core 的规范 您有: * 过时的源代码库,您可以使用 pod repo update 或 @987654324 进行更新@。 * 输入错误的名称或版本。 * 未将托管 Podspec 的源代码库添加到您的 Podfile。
  • 在我做某事后React-logger 错误更改为[!] Unable to find a specification for 'React-perflogger (= 0.66.2)' depended upon by 'React-Core'
  • @BobSteel 您能否将 Podfile 包含在您的问题中
  • 我包含了我的 Podfile。看看,谢谢。
  • @BobSteel 你原来的问题已经解决了,但是你上面提到的错误是因为缺少一些依赖,我建议删除/node_modules,Podfile.lock,Pods文件夹,然后运行“npm install”和“吊舱安装”
【解决方案2】:

对不起各位!我只是将丢失的 perflogger 包含在 podfile 中。并且 cmd 也会触发其他一些文件。现在它工作正常。谢谢大家!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-05-12
    • 2022-08-04
    • 2019-03-27
    • 2020-03-24
    • 1970-01-01
    • 2017-01-14
    • 2019-09-12
    • 2014-06-05
    相关资源
    最近更新 更多