Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

react-native run-android stops with 'gradlew installDebug' failed

Errorreact-native run-android ends at the installDebug step on Windows

Short answer

That line only says the Gradle task behind run-android failed. The reason is in the Gradle output, so run the same task by hand with a stack trace and read the first error. Four causes cover most cases: a stuck adb server, no emulator or phone online, a JDK newer than 17, or a missing ANDROID_HOME.

  • Applies to React Native 0.8x, React Native CLI, Windows 11, Gradle 8 and 9, JDK 17
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    react-native run-android runs the installDebug Gradle task by default and prints only a short wrapper message. Run that task yourself from the android folder with a stack trace. The first line that starts with a cause or an error names the real problem.

    cd android
    gradlew.bat app:installDebug --stacktrace
  2. 2Match what you see, then jump to its fix

    1. 1Execution failed for task ':app:installDebug' with com.android.ddmlib.ShellCommandUnresponsiveException in the cause.The adb server is stuckFix
    2. 2adb devices prints an empty list, or the device state is offline.No emulator or phone is onlineFix
    3. 3gradlew.bat -version shows a JVM above 17, and the Gradle output reports a Java or Gradle compatibility problem.The JDK is newer than the one React Native expectsFix
    4. 4adb is not recognized as a command, or echo %ANDROID_HOME% prints the variable name back instead of a folder.ANDROID_HOME is not set, so the SDK tools are not foundFix

What does the error look like?

  • react-native run-android ends at the installDebug step on Windows
  • Execution failed for task ':app:installDebug'.
  • com.android.ddmlib.ShellCommandUnresponsiveException

Cause 1 of 4

The adb server is stuck

1Check

The React Native troubleshooting page lists this exact exception and says to restart the adb server. Ask adb what it sees first.

adb devices -l

2Fix

Stop the adb server and start it again, then run the app again.

adb kill-server
adb start-server

3Verify

adb devices lists your emulator or phone as device, and the install runs.

adb devices
npx react-native run-android

Confirmed by reactnative.dev

Did this fix it?

Cause 2 of 4

No emulator or phone is online

1Check

adb reports a state for each device. offline means it is not connected or not responding, and no device means nothing is attached. The state device is the normal working one. A just-started emulator can also be missing from the list if it was started before the adb server.

adb devices -l

2Fix

Start an emulator from the AVD Manager in Android Studio, or plug in a phone with a USB cable, with USB debugging switched on in its developer options. If a running emulator is missing from the list, stop the adb server and start it again, then list the devices once more.

adb kill-server
adb start-server
adb devices

3Verify

The device shows the state device in the list.

adb devices -l

Confirmed by developer.android.com

Did this fix it?

Cause 3 of 4

The JDK is newer than the one React Native expects

1Check

The React Native setup guide recommends JDK 17 and warns of problems with higher versions. Gradle takes its JVM from JAVA_HOME, and org.gradle.java.home in gradle.properties wins over it for the build process.

cd android
gradlew.bat -version
echo %JAVA_HOME%
findstr "org.gradle.java.home" gradle.properties

2Fix

Install JDK 17, point JAVA_HOME at it in the Windows environment variables, and remove or correct org.gradle.java.home if gradle.properties sets another one. Open a new Command Prompt afterwards so it reads the change.

:: current Command Prompt only; make it permanent in the Windows environment variables window
:: example path, use the folder of your own JDK 17
set JAVA_HOME=C:\Program Files\Java\jdk-17

3Verify

In a new Command Prompt, gradlew.bat -version reports a 17.x JVM.

cd android
gradlew.bat -version

Confirmed by reactnative.dev

Did this fix it?

Cause 4 of 4

ANDROID_HOME is not set, so the SDK tools are not found

1Check

The setup guide has Windows users create an ANDROID_HOME user variable and add the platform-tools folder to Path. By default the SDK is installed under %LOCALAPPDATA%\Android\Sdk.

echo %ANDROID_HOME%
adb devices

2Fix

Create the ANDROID_HOME user variable with the SDK folder, add %LOCALAPPDATA%\Android\Sdk\platform-tools to Path, and open a new Command Prompt.

:: current Command Prompt only; make both permanent in the Windows environment variables window
set ANDROID_HOME=%LOCALAPPDATA%\Android\Sdk
set PATH=%PATH%;%LOCALAPPDATA%\Android\Sdk\platform-tools

3Verify

In a new Command Prompt the variable prints a folder and adb devices runs.

echo %ANDROID_HOME%
adb devices

Confirmed by reactnative.dev

Did this fix it?

How do I stop it coming back?

  • Keep one JDK 17 installation and point JAVA_HOME at it, so Gradle and Android Studio agree.
  • Start the emulator before running the app, and run adb devices once to see it listed.
  • Run gradlew.bat app:installDebug --stacktrace whenever run-android prints only the wrapper message.
  • Set ANDROID_HOME and Path once per machine and check them again after reinstalling Android Studio.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Gradle cannot find the Android SDK on this machine

FAILURE: Build failed with an exception. What went wrong: SDK location not found.

Gradle looks for the Android SDK in the sdk.dir line of android/local.properties and in the ANDROID_HOME environment variable, and found neither.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.