react-native: error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 :ReactNative:Unexpected empty result of running 'npx.cmd --quiet --no-install react-native config' command from 'null' directory. :ReactNative:Running 'npx.cmd --quiet --no-install react-native config' command from 'null' directory failed.
FAILURE: Build failed with an exception.
-
Where: Script ‘C:\react\zinia\node_modules@react-native-community\cli-platform-android\native_modules.gradle’ line: 170
-
What went wrong: A problem occurred evaluating script.
Command
config
unrecognized. Make sure that you have runnpm install
and that you are inside a react-native project.
-
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
-
Get more help at https://help.gradle.org
BUILD FAILED in 3s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 :ReactNative:Unexpected empty result of running ‘npx.cmd --quiet --no-install react-native config’ command from ‘null’ directory. :ReactNative:Running ‘npx.cmd --quiet --no-install react-native config’ command from ‘null’ directory failed.
FAILURE: Build failed with an exception.
-
Where: Script ‘C:\react\zinia\node_modules@react-native-community\cli-platform-android\native_modules.gradle’ line: 170
-
What went wrong: A problem occurred evaluating script.
Command
config
unrecognized. Make sure that you have runnpm install
and that you are inside a react-native project.
-
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
-
Get more help at https://help.gradle.org
BUILD FAILED in 3s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (C:\react\zinia\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\react\zinia\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\react\zinia\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (C:\react\zinia\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:164:9)
React Native version:
Steps To Reproduce
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 20
- Comments: 27 (4 by maintainers)
Thanks everyone for the help!
I closed this issue because it didn’t fit the template or include a meaningful description.
The comment must have got lost in the process sorry about that.
I faced the same problem.
npx --quiet react-native config
ornpx.cmd --quiet react-native config
That command, if you execute in the root directory of your react native project, will produce JSON output (if everything is configured correctly). The problem is, I did not locate my react native project in the root folder of the git repository. After then, I created another git repo and set the root folder of the repo to be the root folder of the react native project, and everything is ok then.On my side issue 838 allowed me to solve the issue. I uninstalled and reinstalled globally:
npm uninstall -g react-native react-native-cli
npm install -g react-native react-native-cli
react-native start --reset-cache
Then cleaned the project and built again.Don’t be too harsh if it doesn’t work for you 😉 Also, I am not 100% it helps in this case, but the interesting read that led me to the solution was issue #804, because at core it seems to be related to the build script not calling npx from the root React Native directory.
the same bug … I ever have seen
@rickhanlonii I’ve created #27707 using a template. Let me know if you nee more information.
This was helpful. Thanks
If anyone is still seeing this issue, please submit a new issue that conforms to the bug template and we’ll take a look.
I am also facing the same problem . Is there any work around?