Repository navigation
Closed
Labels
Description
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.7Description
[!] 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
endthis 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",
```
Activity
thymikee commentedon Nov 20, 2019
When did it start happening? Can you provide a repro? Running
npx react-native configwould be helpful as wellsibelius commentedon Nov 20, 2019
we upgrade from cli v2 to cli v3
npx react-native config
sibelius commentedon Nov 21, 2019
same error on android
[-]nvalid `Podfile` file: undefined method `[]' for nil:NilClass.[/-][+]Invalid `Podfile` file: undefined method `[]' for nil:NilClass.[/+]sibelius commentedon Nov 21, 2019
it is breaking here
https://github.com/react-native-community/cli/blob/master/packages/platform-ios/native_modules.rb#L29
I think this pull request caused the problem:
#767
npx --quiet react-native config
returns
sibelius commentedon Nov 21, 2019
I think the problem is that
npx --quiet react-native configreturns different data when we run it insideapp/iosandappso, my guess is that
react-native configis causing this troublesibelius commentedon Nov 21, 2019
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 commentedon Dec 6, 2019
Found the same thing on a project I'm working on. I can't seem to fix it as I am currently using the @react-native-community/cli that comes with the react-native version I'm using.
I have a monorepo setup as well:
if I run
npx --quiet react-native configfrom root or packages the output looks fine, but if I run it from anywhere within mobile I get:{ "root": "/projects/MyProject/packages/mobile", "reactNativePath": "/projects/MyProject/node_modules/react-native", "dependencies": {}, "commands": [], "assets": [], "platforms": {}, "haste": { "providesModuleNodeModules": [], "platforms": [] }, "project": {} }Which seems to by why I can't run
pod installas it's running thenpx --quiet react-native config. Can this be overridden with a config file? Would love to get my project building again.sibelius commentedon Dec 6, 2019
@cjam check here #875
cjam commentedon Dec 6, 2019
Hm. so that's related to the android side of things. It looks like it might be a bug in the
react-native configcommand as it just isn't returning the right information when it's inside the mobile or ios folders. I made the following modification in mynode_modules/@react-native-community/cli-platform-ios/native_modules.rb:Then ran:
cd ios pod installand everything worked. It's a hack of course, but it seems that for some reason the cli can't determine the locations for the native projects when run inside of the mobile or ios folder.
sibelius commentedon Dec 6, 2019
you can use patch-package until a fix lands
thymikee commentedon Feb 18, 2020
@cjam @sibelius this should not be necessary anymore, since in v3.1 we migrated off of
npxthere.Please update the
@react-native-community/clito the latest version.mikedizon commentedon Feb 18, 2020
@thymikee I'm running 3.2.0 and I still get the same error when running pod install
7 remaining items
thymikee commentedon Feb 19, 2020
@mikedizon you have global
react-nativeorreact-native-clior both installed. You need to remove them from npm and yarn and never install again.mikedizon commentedon Feb 19, 2020
@thymikee thanks, i removed
react-native-clifrom my global packages.running
react-nativecommands now returns command not found, so I rannpx react-native configfrom the mobile directory. The only package returned wasreact-native-vector-icons.Running
yarn workspace mobile react-native configreturnsthe contents of my
react-native.configarethymikee commentedon Feb 19, 2020
Do you have a
package.jsoninpackages/mobile? Where arepackage.jsons and what native packages are inside? With a reproduction we could avoid these questions, just saying.ahmaddehnavi commentedon Jul 30, 2020
I had upgraded from
61.5to63.1and my problem solved when removingpathparam fromuse_react_native!in podfilesomething like this:
config = use_native_modules!use_react_native!Daniel-Griffiths commentedon Aug 14, 2020
Thanks @ahmaddehnavi that worked for me 😄
sulagarde commentedon Nov 10, 2020
Hi! I just upgrading RN from 0.60.6 to 0.61.5 and I get the same error code (cli version => 3.2.1, cli-platform-ios => 3.2.1, cli-platform-android => 3.1.4 ).
I use yarn workspace this way:
"react": "16.9.0",
"react-native": "0.61.5",
"@react-native-community/async-storage": "1.12.1",
"@react-native-community/clipboard": "1.4.0",
"@react-native-community/cameraroll": "~1.6.x",
"@react-native-community/viewpager": "3.0.0",
"@react-native-community/netinfo": "5.6.2",
"@react-native-community/push-notification-ios": "1.7.1",
"@react-native-firebase/app": "8.4.7",
"@react-native-firebase/crashlytics": "8.4.12",
"@react-native-firebase/dynamic-links": "7.5.11",
"@react-native-firebase/messaging": "7.9.2",
"@react-native-firebase/perf": "7.4.10",
"react-native-app-auth": "5.x",
"react-native-android-badge": "^0.5.0",
"react-native-camera": "3.40.0",
"react-native-config": "0.12.0",
"react-native-check-app-install": "0.0.5",
"react-native-exit-app": "1.1.0",
"react-native-file-viewer": "2.1.3",
"react-native-image-crop-picker": "0.25.3",
"react-native-inappbrowser-reborn": "3.4.0",
"react-native-jitsi-meet": "2.1.1",
"react-native-gesture-handler": "1.4.0",
"react-native-linear-gradient": "2.5.6",
"react-native-localize": "1.1.4",
"react-native-reanimated": "1.8.0",
"react-native-screens": "1.0.0-alpha.23",
"react-native-splash-screen": "3.2.0",
"react-native-svg": "9.5.3",
"react-native-thumbnail": "https://github.com/phuochau/react-native-thumbnail.git",
"react-native-vector-icons": "6.6.0",
"react-native-version-check": "3.1.0",
"react-native-view-overflow": "0.0.4",
"react-native-webview": "7.0.1",
"react-native-youtube-sdk": "1.0.12",
"rn-fetch-blob": "0.12.0"
When I run npx react-natif config from root folder (with no dependencies) the result is something like this =>
{
"root": "/path/to/project/directory/packages/mobile",
"reactNativePath": "/path/to/project/directory/node_modules/react-native",
"dependencies": {},
"commands": [],
"assets": [],
"platforms": {},
"haste": {
"providesModuleNodeModules": [],
"platforms": []
},
"project": {}
}
If I run in the command in src/appli/common, all dependencies are listed.
Is there something I am doing wrong?
octopicorn commentedon Jan 5, 2021
@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-nativeis at the root directory, but my app's Podfile is down under/packages/myproject/iosso I use this in my Podfile:all i did was pass in a custom path, and added some extra
../as needed to make it correctchetstone commentedon Dec 13, 2021
I had a dummy package.json in my iOS folder. Removing it fixed this problem. Yay!
I had put it in there to work around a problem building iOS back in RN32
ZainabShakeel commentedon Jan 30, 2022
few files in iOS folder was deleted so beacuse of this i was facing this issues
restore those files fix my problem
LoserAntbear commentedon Apr 17, 2022
Same thing happened for me when I tried to list dependencies as peer-ones.
So I had to move them back to regular "dependencies".
But I'm developing an internal package for RN projects, I still need these dependencies to be listed as peer-ones. Any advice on that, please?
gabrieldonadel commentedon Nov 8, 2023
If you're encountering this just delete node_modules and install again, in my case
"project": {}was emptynithinyell commentedon Dec 14, 2023
Some times you may also need to check the

Command line tool was set correctly in xcodeLorandP commentedon Apr 3, 2024
@nithinyell Thank you! I had the same issue and found it with your help
longmao commentedon May 9, 2024
so cool!