首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未定义的方法`use_unimodules!‘安装时,本机-单模

未定义的方法`use_unimodules!‘安装时,本机-单模
EN

Stack Overflow用户
提问于 2021-07-16 14:35:38
回答 1查看 502关注 0票数 0

按照指南安装react-native-unimodules时,执行pod install时会出现以下错误

代码语言:javascript
复制
[!] 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文件

代码语言:javascript
复制
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

对发生了什么事有什么想法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-07-16 17:30:21

react-native-unimodules的安装需要使用自己的cocoapods。如果将下面的行添加到use_unimodules!的第三行中,则将定义Podfile

代码语言:javascript
复制
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68410860

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档