question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] can't run application - command config not recognized

See original GitHub issue

when running the application on android using react-native run-android I get this error:

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 app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running 'npx --quiet --no-install react-native config' command from 'null' directory.
:ReactNative:Running 'npx --quiet --no-install react-native config' command from 'null' directory failed.

FAILURE: Build failed with an exception.

* Where:
Script '/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 run `npm 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 682ms

    at checkExecSyncError (child_process.js:603:11)
    at execFileSync (child_process.js:621:15)
    at runOnAllDevices (/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
    at buildAndRun (/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)
    at /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 (/node_modules/@react-native-community/cli/build/index.js:164:9)

React Native version: System: OS: macOS 10.15.1 CPU: (12) x64 Intel® Core™ i7-8850H CPU @ 2.60GHz Memory: 274.45 MB / 16.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 13.1.0 - /usr/local/bin/node Yarn: 1.19.1 - /usr/local/bin/yarn npm: 6.12.1 - /usr/local/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 IDEs: Android Studio: 3.5 AI-191.8026.42.35.5977832 Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild npmPackages: react: 16.12.0 => 16.12.0 react-native: 0.61.5 => 0.61.5

Describe what you expected to happen: The app should run on the Android simulator

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:18
  • Comments:31

github_iconTop GitHub Comments

9reactions
jonakydcommented, Jan 22, 2020

You can temporarily bypass the issue by forcing the @react-native-community/cli-platform-android to use the older version 3.0.2.

dependencies: {
    ...
    "@react-native-community/cli-platform-android": "3.0.2",
    ...
}
5reactions
idanlocommented, Dec 20, 2019

I looked at the file the error was coming from - project_root/node_modules/@react-native-community/cli-platform-android/native_modules.gradle, and in line 194, the second parameter to the getCommandOutput function was commented, so it was null. And this is why the error was - :ReactNative:Running 'npx --quiet --no-install react-native config' command from 'null' directory failed., I removed the comment from the dir parameter and the build now works.

But why does it only error for me and a few other people?

Edit: The app runs but I only get a blank white screen

Read more comments on GitHub >

github_iconTop Results From Across the Web

android' is not recognized as an internal or external command
Set up three new system variable (Control Panel\System and Security\System Advance system ->settings->environment variables-system variables).
Read more >
Create and edit run/debug configurations - Android Developers
To use a saved run/debug configuration, follow these steps: Select the run/debug configuration from the Select Run/Debug Configuration drop-down list within ...
Read more >
Android Emulator Troubleshooting - Xamarin - Microsoft Learn
If the emulator does not appear in this list, start the Android SDK Manager, apply all updates, then try launching the emulator again....
Read more >
How to fix "Android Studio doesn't see device" in Android ...
However, the button Run does not allow to deploy the app to the connected device ... Configuring Your System to Detect Your Android...
Read more >
Configuring Your System to Detect Your Android Device
If your Android device was previously shown in RAD Studio but is not shown now, try uninstalling the USB driver, disconnecting the device,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found