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

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

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 18
  • Comments: 31 (1 by maintainers)

Most upvoted comments

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",
    ...
}

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

deleting node_modules and reinstalling dependencies doesn’t work for me. still the same error

@Elias-Graf I just tried installing 0.61.2, still the same error for me

Yes I have rebuilt the app and ran yarn. I don’t think restarting the computer is necessary

@Elias-Graf My version already doesn’t have the ^ - "react-native": "0.61.5"

Facing the same issue

`C:\Users\butle\Desktop\College\FYPprototype\android>gradlew clean --debug 17:56:45.384 [INFO] [org.gradle.internal.nativeintegration.services.NativeServices] Initialized native services in: C:\Users\butle.gradle\native 17:56:45.729 [DEBUG] [org.gradle.internal.nativeintegration.services.NativeServices] Native-platform posix files integration is not available. Continuing with fallback. 17:56:45.780 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClient] Executing build e9672c5c-72f1-4806-8b5d-5386aa4f1961 in daemon client {pid=13828} 17:56:45.946 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Software Loopback Interface 1 17:56:45.947 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? true 17:56:45.948 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /127.0.0.1 17:56:45.948 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /0:0:0:0:0:0:0:1 17:56:45.948 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft 6to4 Adapter 17:56:45.949 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.949 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface WAN Miniport (L2TP) 17:56:45.951 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.951 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Kernel Debug Network Adapter 17:56:45.953 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.954 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface WAN Miniport (PPTP) 17:56:45.956 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.956 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft IP-HTTPS Platform Adapter 17:56:45.957 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.957 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Realtek PCIe GbE Family Controller 17:56:45.959 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.959 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /192.168.1.6 17:56:45.959 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /2001:bb6:8540:1f58:1073:f56a:28a:b618 17:56:45.959 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /2001:bb6:8540:1f58:20d4:1949:362f:d26a 17:56:45.959 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /2001:bb6:8540:1f58:c0d4:b517:ece3:9c3a 17:56:45.959 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:1073:f56a:28a:b618%eth1 17:56:45.959 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter 17:56:45.961 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.961 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #4 17:56:45.962 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.962 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:581:e0c9:9f69:b959%wlan1 17:56:45.962 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface WAN Miniport (PPPOE) 17:56:45.964 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.964 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface WAN Miniport (IPv6) 17:56:45.966 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.966 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Teredo Tunneling Adapter 17:56:45.967 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.967 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #3 17:56:45.969 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.969 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:c88d:237:3831:970f%wlan2 17:56:45.969 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Intel® Wireless-AC 9560 160MHz 17:56:45.971 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.971 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:3188:b2e7:c54e:8a53%wlan3 17:56:45.971 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Bluetooth Device (Personal Area Network) 17:56:45.973 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.973 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:b46f:e3a1:7770:a171%eth3 17:56:45.973 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface WAN Miniport (IKEv2) 17:56:45.974 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.974 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface VirtualBox Host-Only Ethernet Adapter 17:56:45.976 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.976 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /192.168.56.1 17:56:45.976 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:c4c4:d1c5:27a6:ea2c%eth4 17:56:45.976 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface WAN Miniport (Network Monitor) 17:56:45.977 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.977 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #2 17:56:45.979 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.979 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface WAN Miniport (SSTP) 17:56:45.981 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.981 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface WAN Miniport (IP) 17:56:45.982 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.982 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface VirtualBox Host-Only Ethernet Adapter-WFP Native MAC Layer LightWeight Filter-0000 17:56:45.984 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.984 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface VirtualBox Host-Only Ethernet Adapter-QoS Packet Scheduler-0000 17:56:45.986 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.986 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface VirtualBox Host-Only Ethernet Adapter-WFP 802.3 MAC Layer LightWeight Filter-0000 17:56:45.987 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:45.987 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Realtek PCIe GbE Family Controller-WFP Native MAC Layer LightWeight Filter-0000 17:56:45.989 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.013 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Realtek PCIe GbE Family Controller-VirtualBox NDIS Light-Weight Filter-0000 17:56:46.015 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.015 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Realtek PCIe GbE Family Controller-QoS Packet Scheduler-0000 17:56:46.017 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.017 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Realtek PCIe GbE Family Controller-WFP 802.3 MAC Layer LightWeight Filter-0000 17:56:46.018 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.018 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Intel® Wireless-AC 9560 160MHz-WFP Native MAC Layer LightWeight Filter-0000 17:56:46.020 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.020 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Intel® Wireless-AC 9560 160MHz-Virtual WiFi Filter Driver-0000 17:56:46.022 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.022 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Intel® Wireless-AC 9560 160MHz-Native WiFi Filter Driver-0000 17:56:46.023 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.023 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Intel® Wireless-AC 9560 160MHz-VirtualBox NDIS Light-Weight Filter-0000 17:56:46.025 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.025 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Intel® Wireless-AC 9560 160MHz-QoS Packet Scheduler-0000 17:56:46.027 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.027 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Intel® Wireless-AC 9560 160MHz-WFP 802.3 MAC Layer LightWeight Filter-0000 17:56:46.028 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.029 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #3-WFP Native MAC Layer LightWeight Filter-0000 17:56:46.030 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.030 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #3-Native WiFi Filter Driver-0000 17:56:46.032 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.032 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface WAN Miniport (IP)-WFP Native MAC Layer LightWeight Filter-0000 17:56:46.034 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.034 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface WAN Miniport (IP)-QoS Packet Scheduler-0000 17:56:46.035 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.035 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface WAN Miniport (IPv6)-WFP Native MAC Layer LightWeight Filter-0000 17:56:46.037 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.037 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface WAN Miniport (IPv6)-QoS Packet Scheduler-0000 17:56:46.039 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.039 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface WAN Miniport (Network Monitor)-WFP Native MAC Layer LightWeight Filter-0000 17:56:46.040 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.040 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface WAN Miniport (Network Monitor)-QoS Packet Scheduler-0000 17:56:46.042 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.042 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #3-VirtualBox NDIS Light-Weight Filter-0000 17:56:46.044 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.044 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #3-QoS Packet Scheduler-0000 17:56:46.046 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.046 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #3-WFP 802.3 MAC Layer LightWeight Filter-0000 17:56:46.048 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.048 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #4-WFP Native MAC Layer LightWeight Filter-0000 17:56:46.049 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.049 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #4-Native WiFi Filter Driver-0000 17:56:46.051 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.051 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #4-VirtualBox NDIS Light-Weight Filter-0000 17:56:46.053 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.053 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #4-QoS Packet Scheduler-0000 17:56:46.054 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.054 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #4-WFP 802.3 MAC Layer LightWeight Filter-0000 17:56:46.056 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false 17:56:46.061 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry. 17:56:46.063 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry. 17:56:46.066 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry. 17:56:46.068 [INFO] [org.gradle.launcher.daemon.client.DefaultDaemonConnector] Found daemon DaemonInfo{pid=19512, address=[c8656ca1-2f80-4978-90f2-d873712d4525 port:65164, addresses:[/127.0.0.1, /0:0:0:0:0:0:0: 1]], state=Idle, lastBusy=1575913942690, context=DefaultDaemonContext[uid=0f9af5a8-25cb-40cf-9fed-197fbff0e791,javaHome=C:\Program Files\Android\Android Studio\jre,daemonRegistryDir=C:\Users\butle.gradle\daemo n,pid=19512,idleTimeout=10800000,priority=NORMAL,daemonOpts=-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=windows-1252,-Duser.country=IE,-Duser.language=en,-Duser.v ariant]} however its context does not match the desired criteria. Java home is different. Wanted: DefaultDaemonContext[uid=null,javaHome=C:\Program Files\Java\jdk1.8.0_221,daemonRegistryDir=C:\Users\butle.gradle\daemon,pid=13828,idleTimeout=null,priority=NORMAL,daemonOpts=-XX:MaxMetaspaceSize=256m, -XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=windows-1252,-Duser.country=IE,-Duser.language=en,-Duser.variant] Actual: DefaultDaemonContext[uid=0f9af5a8-25cb-40cf-9fed-197fbff0e791,javaHome=C:\Program Files\Android\Android Studio\jre,daemonRegistryDir=C:\Users\butle.gradle\daemon,pid=19512,idleTimeout=10800000,priority =NORMAL,daemonOpts=-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=windows-1252,-Duser.country=IE,-Duser.language=en,-Duser.variant]

Looking for a different daemon… 17:56:46.069 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpOutgoingConnector] Attempting to connect to [88f64f5f-1855-4bac-aecc-855e8ed885bd port:50680, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]]. 17:56:46.069 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpOutgoingConnector] Trying to connect to address /127.0.0.1. 17:56:46.071 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpOutgoingConnector] Connected to address /127.0.0.1:50680. 17:56:46.087 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClient] Connected to daemon DaemonInfo{pid=15264, address=[88f64f5f-1855-4bac-aecc-855e8ed885bd port:50680, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1] ], state=Idle, lastBusy=1575914198540, context=DefaultDaemonContext[uid=e2fd2d7d-fc12-47aa-a72d-78c6b41fc8e4,javaHome=C:\Program Files\Java\jdk1.8.0_221,daemonRegistryDir=C:\Users\butle.gradle\daemon,pid=15264 ,idleTimeout=10800000,priority=NORMAL,daemonOpts=-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=windows-1252,-Duser.country=IE,-Duser.language=en,-Duser.variant]}. D ispatching request Build{id=e9672c5c-72f1-4806-8b5d-5386aa4f1961, currentDir=C:\Users\butle\Desktop\College\FYPprototype\android}. 17:56:46.087 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: dispatching class org.gradle.launcher.daemon.protocol.Build 17:56:46.093 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClient] Received result org.gradle.launcher.daemon.protocol.BuildStarted@3bf7ca37 from daemon DaemonInfo{pid=15264, address=[88f64f5f-1855-4bac-aecc -855e8ed885bd port:50680, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], state=Idle, lastBusy=1575914198540, context=DefaultDaemonContext[uid=e2fd2d7d-fc12-47aa-a72d-78c6b41fc8e4,javaHome=C:\Program Files\Java\jdk1 .8.0_221,daemonRegistryDir=C:\Users\butle.gradle\daemon,pid=15264,idleTimeout=10800000,priority=NORMAL,daemonOpts=-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=win dows-1252,-Duser.country=IE,-Duser.language=en,-Duser.variant]} (build should be starting). 17:56:46.095 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] The client will now receive all logging from the daemon (pid: 15264). The daemon log file: C:\Users\butle.gradle\daemon\5.5\daemon-15264 .out.log 17:56:46.095 [INFO] [org.gradle.launcher.daemon.server.exec.LogAndCheckHealth] Starting 6th build in daemon [uptime: 4 mins 55.779 secs, performance: 100%, non-heap usage: 10% of 268.4 MB] 17:56:46.095 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has started executing the build. 17:56:46.095 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] Executing build with daemon context: DefaultDaemonContext[uid=e2fd2d7d-fc12-47aa-a72d-78c6b41fc8e4,javaHome=C:\Program Files\Java\jdk1. 8.0_221,daemonRegistryDir=C:\Users\butle.gradle\daemon,pid=15264,idleTimeout=10800000,priority=NORMAL,daemonOpts=-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=wind ows-1252,-Duser.country=IE,-Duser.language=en,-Duser.variant] 17:56:46.096 [INFO] [org.gradle.internal.work.DefaultWorkerLeaseService] Using 8 worker leases. 17:56:46.098 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Creating new cache for fileHashes, path C:\Users\butle\Desktop\College\FYPprototype\android.gradle\5.5\fileHashes\fileHashes.bin, access org. gradle.cache.internal.DefaultCacheAccess@7904698e 17:56:46.098 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Acquiring file lock for file hash cache (C:\Users\butle\Desktop\College\FYPprototype\android.gradle\5.5\fileHashes) 17:56:46.099 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on file hash cache (C:\Users\butle\Desktop\College\FYPprototype\android.gradle\5.5\fileHashes). 17:56:46.099 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on file hash cache (C:\Users\butle\Desktop\College\FYPprototype\android.gradle\5.5\fileHashes). 17:56:46.102 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation ‘Run build’ started 17:56:46.102 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1 started (1 worker(s) in use). 17:56:46.102 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 4: acquired lock on root.1 17:56:46.102 [INFO] [org.gradle.internal.buildevents.BuildLogger] Starting Build 17:56:46.102 [DEBUG] [org.gradle.internal.buildevents.BuildLogger] Gradle user home: C:\Users\butle.gradle 17:56:46.102 [DEBUG] [org.gradle.internal.buildevents.BuildLogger] Current dir: C:\Users\butle\Desktop\College\FYPprototype\android 17:56:46.102 [DEBUG] [org.gradle.internal.buildevents.BuildLogger] Settings file: null 17:56:46.102 [DEBUG] [org.gradle.internal.buildevents.BuildLogger] Build file: null 17:56:46.102 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation ‘Load build’ started 17:56:46.103 [DEBUG] [org.gradle.initialization.buildsrc.BuildSourceBuilder] Gradle source dir does not exist. We leave. 17:56:46.103 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation ‘Evaluate settings’ started 17:56:46.104 [DEBUG] [org.gradle.initialization.DefaultGradlePropertiesLoader] Found env project properties: [] 17:56:46.104 [DEBUG] [org.gradle.initialization.DefaultGradlePropertiesLoader] Found system project properties: [] 17:56:46.104 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation ‘Apply script settings.gradle to settings ‘android’’ started 17:56:46.105 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation ‘Apply script native_modules.gradle to settings ‘FYPprototype’’ started 17:56:46.565 [ERROR] [org.gradle.api.Script] :ReactNative:Unexpected empty result of running ‘npx.cmd --quiet --no-install react-native config’ command from ‘null’ directory. 17:56:46.565 [ERROR] [org.gradle.api.Script] :ReactNative:Running ‘npx.cmd --quiet --no-install react-native config’ command from ‘null’ directory failed. 17:56:46.565 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation ‘Apply script native_modules.gradle to settings ‘FYPprototype’’ 17:56:46.565 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation ‘Apply script native_modules.gradle to settings ‘FYPprototype’’ completed 17:56:46.565 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation ‘Apply script settings.gradle to settings ‘android’’ 17:56:46.566 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation ‘Apply script settings.gradle to settings ‘android’’ completed 17:56:46.566 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation ‘Evaluate settings’ 17:56:46.566 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation ‘Evaluate settings’ completed 17:56:46.566 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation ‘Load build’ 17:56:46.566 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation ‘Load build’ completed 17:56:46.566 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1 completed (0 worker(s) in use) 17:56:46.566 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 4: released lock on root.1 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception. 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Where: 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Script ‘C:\Users\butle\Desktop\College\FYPprototype\node_modules@react-native-community\cli-platform-android\native_modules.gradle’ line: 170 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong: 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] A problem occurred evaluating script. 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Command config unrecognized. Make sure that you have run npm install and that you are inside a react-native project. 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try: 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. Run with --scan to get full insights. 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] 17:56:46.567 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 1s 17:56:46.568 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation ‘Run build’ 17:56:46.568 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation ‘Run build’ completed 17:56:46.571 [DEBUG] [org.gradle.deployment.internal.DefaultDeploymentRegistry] Stopping 0 deployment handles 17:56:46.571 [DEBUG] [org.gradle.deployment.internal.DefaultDeploymentRegistry] Stopped deployment handles 17:56:46.571 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Releasing file lock for file hash cache (C:\Users\butle\Desktop\College\FYPprototype\android.gradle\5.5\fileHashes) 17:56:46.571 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on file hash cache (C:\Users\butle\Desktop\College\FYPprototype\android.gradle\5.5\fileHashes). 17:56:46.580 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has finished executing the build. 17:56:46.607 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientInputForwarder] Dispatching close input message: org.gradle.launcher.daemon.protocol.CloseInput@495456d4 17:56:46.607 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 15: dispatching class org.gradle.launcher.daemon.protocol.CloseInput 17:56:46.608 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClient] Received result Success[value=org.gradle.launcher.exec.BuildActionResult@394df057] from daemon DaemonInfo{pid=15264, address=[88f64f5f-1855- 4bac-aecc-855e8ed885bd port:50680, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], state=Idle, lastBusy=1575914198540, context=DefaultDaemonContext[uid=e2fd2d7d-fc12-47aa-a72d-78c6b41fc8e4,javaHome=C:\Program Files
Java\jdk1.8.0_221,daemonRegistryDir=C:\Users\butle.gradle\daemon,pid=15264,idleTimeout=10800000,priority=NORMAL,daemonOpts=-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.enc oding=windows-1252,-Duser.country=IE,-Duser.language=en,-Duser.variant]} (build should be done). 17:56:46.608 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: dispatching class org.gradle.launcher.daemon.protocol.Finished 17:56:46.608 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: connection stop `

here is my package.json

{ "name": "FYPprototype", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "@react-native-community/async-storage": "^1.6.3", "@react-native-firebase/app": "^6.2.0", "@react-native-firebase/firestore": "^6.2.0", "jetifier": "^1.6.4", "react": "16.9.0", "react-native": "^0.61.4", "react-native-async-storage": "0.0.1", "react-native-drawer": "^2.5.1", "react-native-elements": "^1.2.7", "react-native-firebase": "^5.5.6", "react-native-gesture-handler": "^1.5.1", "react-native-progress": "^4.0.2", "react-native-reanimated": "^1.4.0", "react-native-tab-view": "^2.11.0", "react-native-vector-icons": "^6.6.0", "react-native-webview": "^7.5.2", "react-navigation": "^4.0.10", "react-navigation-stack": "^1.10.3" }, "devDependencies": { "@babel/core": "^7.7.4", "@babel/runtime": "^7.7.4", "@react-native-community/eslint-config": "^0.0.5", "abcjs": "^5.10.3", "babel-jest": "^24.9.0", "eslint": "^5.0.0", "jest": "^24.9.0", "metro-react-native-babel-preset": "^0.56.0", "react-native-cli": "^2.0.1", "react-native-debugger-open": "^0.3.23", "react-test-renderer": "16.9.0", "typescript": "^3.7.3" }, "jest": { "preset": "react-native", "setupFiles": [ "./node_modules/react-native-gesture-handler/jestSetup.js" ] } }

Tried removing the ^ from the react-native version and reinstalling but got same error

I temporarily resolved this by changing the react-nativeversion in the package.json from ^0.61.2 to 0.61.2 and then running npm install

there is no react-native cli global package anymore

image

more info at https://github.com/react-native-community/cli#usage-in-an-existing-react-native-project

What output does react-native --version give you?

mine is:

react-native-cli: 2.0.1
react-native: 0.61.2

Which seems to be working, but any newer version of react-native will break the run-android command. (at least for me)

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",
    ...
}

had same issue, this workaround has worked for me too