0

按照指南进行安装时,react-native-unimodules我在执行以下操作时出现以下错误pod install

[!] Invalid `Podfile` file: undefined method `use_unimodules!' for #<Pod::Podfile:0x00007ff24708eaa8>
Did you mean?  use_native_modules!.

 #  from /Users/Shared/workspace/App/ios/Podfile:7
 #  -------------------------------------------
 #  target 'reactProducerApp' do
 >    use_unimodules!
 #    config = use_native_modules!
 #  -------------------------------------------

这是我的 Pod 文件

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'

target 'reactProducerApp' do
  use_unimodules!
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )

  target 'reactProducerAppTests' 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)
  end
end

关于发生了什么的任何想法?

4

1 回答 1

1

安装react-native-unimodules需要自己使用cocoapods。如果您将此use_unimodules!行添加到您的Podfile.

require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
于 2021-07-16T17:30:21.963 回答