pod install时报错
[!] Invalid Podfile
file: undefined method `[]’ for nil:NilClass.
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native/scripts/react_native_pods'
platform :ios, '11.0'
target 'NativeOCIosTest' do
# Comment the next line if you don't want to use dynamic frameworks OC 一般不需要使用 use_frameworks!
# use_frameworks!
# react-native 需要的相关配置
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
)
# Pods for NativeOCIosTest
# 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
# 如果使用use_frameworks!需要添加这一部分,如果不使用则不需要(非常重要) OC 一般不需要使用 use_frameworks!
# pre_install do |installer|
# Pod::Installer::Xcode::TargetValidator.send(:define_method,
# :verify_no_static_framework_transitive_dependencies) {}
# end
target 'NativeOCIosTestTests' do
inherit! :search_paths
# Pods for testing
end
target 'NativeOCIosTestUITests' do
# Pods for testing
end
end