反应式pod installe错误无效`podfile`文件:未定义的方法`get_default_flags'对于#< pod :: podfile ...>

发布于 2025-01-21 08:51:04 字数 1398 浏览 3 评论 0原文

我使用React Native,今天我运行POD安装并获得此错误: [!]无效podfile文件:#pod :: podfile:

0x00007f89a2d98d38

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false

target 'MyPrj' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )




  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

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

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

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

。知道为什么会出现,有人可以指导我解决这个问题吗?谢谢

im using React Native, today i run pod install and get this error:
[!] Invalid Podfile file: undefined method `get_default_flags' for #Pod::Podfile:0x00007f89a2d98d38.

here is my pod file:

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false

target 'MyPrj' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )




  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

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

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

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

I dont know why this appear, can anyone guide me to solved this? Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

巷雨优美回忆 2025-01-28 08:51:05

对于每个面对这个问题的人,只需更新package in package.json至 ^0.68.0

for everyone who face this problem, just update react-native in package.json to ^0.68.0

话少情深 2025-01-28 08:51:05

可能您确实忘了在项目的根部运行纱线更新

Probably you did forgot to run yarn update in the root of your project.

涫野音 2025-01-28 08:51:05

在项目根上 -

  • 纱线缓存清洁后跟

命令为我解决了此问题。

On Project root -

  • yarn cache clean followed by
  • yarn

command solved this issue for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文