cli: Invalid `Podfile` file: undefined method `[]' for nil:NilClass.
Environment
System:
OS: macOS 10.15.1
CPU: (4) x64 Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
Memory: 62.27 MB / 16.00 GB
Shell: 5.0.11 - /usr/local/bin/bash
Binaries:
Node: 12.13.0 - /var/folders/n_/30jh5m816yzg3_cftvg647j40000gn/T/yarn--1574276617063-0.927548752503313/node
Yarn: 1.19.1 - /var/folders/n_/30jh5m816yzg3_cftvg647j40000gn/T/yarn--1574276617063-0.927548752503313/yarn
npm: 6.13.0 - ~/.nvm/versions/node/v12.13.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 22, 23, 24, 25, 26, 27, 28
Build Tools: 23.0.1, 23.0.2, 23.0.3, 24.0.0, 24.0.2, 24.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 27.0.3, 28.0.0, 28.0.3
System Images: android-25 | Android TV Intel x86 Atom, android-25 | Google APIs Intel x86 Atom, android-25 | Google APIs Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-N | Android TV Intel x86 Atom, android-N | Android Wear ARM EABI v7a, android-N | Android Wear Intel x86 Atom, android-N | Intel x86 Atom, android-N | Intel x86 Atom_64, android-P | Google Play Intel x86 Atom
Android NDK: 20.1.5948944
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
npmPackages:
@react-native-community/cli: 3.0.4 => 3.0.4
react: 16.9.0 => 16.9.0
react-native: 0.61.4 => 0.61.4
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-create-library: 3.1.2
react-native-git-upgrade: 0.2.7
Description
[!] Invalid `Podfile` file: undefined method `[]' for nil:NilClass.
# from /app/packages/app/ios/Podfile:57
# -------------------------------------------
# # react_native_firebase!
> use_native_modules!
# end
# -------------------------------------------
Reproducible Demo
my podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
# plugin 'cocoapods-fix-react-native'git st
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
# require_relative '../node_modules/@react-native-firebase/app/pod_config'
project 'app', { 'Alpha' => :release, 'Staging' => :release }
target 'app' do
# Comment the next line if you don't want to use dynamic frameworks
# use_frameworks!
# Pods for app
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
# pod 'React-RCTLinking', :podspec => '../node_modules/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios/RNFirebase.podspec'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
target 'appTests' do
inherit! :search_paths
# Pods for testing
end
# react_native_firebase!
use_native_modules!
end
target 'app-tvOS' do
# Comment the next line if you don't want to use dynamic frameworks
# use_frameworks!
# Pods for app-tvOS
target 'app-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
this is a monorepo setup
this is a list of react-native packages used
"@react-native-community/async-storage": "1.6.3",
"@react-native-community/cameraroll": "^1.3.0",
"@react-native-community/cli": "3.0.4",
"@react-native-community/cli-platform-android": "3.0.3",
"@react-native-community/cli-platform-ios": "3.0.0",
"react-native-camera": "3.11.1",
"react-native-device-info": "5.3.1",
"react-native-document-picker": "3.2.4",
"react-native-firebase": "5.5.6",
"react-native-gesture-handler": "1.5.0",
"react-native-image-resizer": "1.1.0",
"react-native-linear-gradient": "2.5.6",
"react-native-localization": "2.1.6",
"react-native-reanimated": "1.4.0",
"react-native-screens": "2.0.0-alpha.11",
"react-native-splash-screen": "3.2.0",
"react-native-svg": "9.13.3",
"react-native-tts": "3.0.0",
"react-native-voice": "git+https://github.com/wenkesj/react-native-voice.git#62a3a0e40fece93c0d4b5c664d563207a960ef87",
"react-native-webview": "7.5.1",
"reanimated-bottom-sheet": "1.0.0-alpha.16",
```
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 33 (15 by maintainers)
I had upgraded from
61.5
to63.1
and my problem solved when removingpath
param fromuse_react_native!
in podfile something like this:config = use_native_modules!
use_react_native!
fixed removing
@react-native-community/cli @react-native-community/cli-platform-android @react-native-community/cli-platform-ios
instead I’ve used the one that react-native 61 depends on
@cjam @sibelius this should not be necessary anymore, since in v3.1 we migrated off of
npx
there. Please update the@react-native-community/cli
to the latest version.Some time you may also need to check the
Command like tool was set correctly in xcode
Do you have a
package.json
inpackages/mobile
? Where arepackage.json
s and what native packages are inside? With a reproduction we could avoid these questions, just saying.we upgrade from cli v2 to cli v3
npx react-native config
@sulagarde I think if you are using workspaces, and your project is nested, you can just pass in a custom relative path to the
use_react_native!
method. My/node_modules/react-native
is at the root directory, but my app’s Podfile is down under/packages/myproject/ios
so I use this in my Podfile:all i did was pass in a custom path, and added some extra
../
as needed to make it correctyou can use patch-package until a fix lands