按照这指南安装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对发生了什么事有什么想法吗?
发布于 2021-07-16 17:30:21
react-native-unimodules的安装需要使用自己的cocoapods。如果将下面的行添加到use_unimodules!的第三行中,则将定义Podfile。
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'https://stackoverflow.com/questions/68410860
复制相似问题