React Native

React Native Android "Execution Failed for Task ':app:installDebug'"

· by DebuggedIt

Quick answer

The :app:installDebug task specifically handles installing the built APK onto a connected device or emulator — a failure here means the build itself likely...

The :app:installDebug task specifically handles installing the built APK onto a connected device or emulator — a failure here means the build itself likely succeeded, but the actual installation step failed, which points toward device connectivity, storage, or app signature conflicts rather than a code or build configuration problem.

The Problem

A React Native Android build completes compilation successfully but fails during installation:

Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: 
  INSTALL_FAILED_UPDATE_INCOMPATIBLE: Existing package signatures do not match

Or a variant without the specific signature detail, sometimes simply reporting a generic installation failure without further explanation in the default output.

Why It Happens

Since this specific task handles the install step (distinct from compilation), the underlying causes are generally about the target device/emulator or the app's existing installed state, rather than the app's source code:

  • An existing installation of the app on the device was signed with a different signing key/certificate than the current build — very common when switching between debug and release builds, or after regenerating a debug keystore, since Android refuses to install an update that doesn't match the existing app's original signature
  • No device or emulator is actually connected and recognized by ADB, or multiple devices are connected with ambiguity about which one the install should target
  • The target device has insufficient storage space to complete the installation
  • A previous installation of the app is in a broken or partially-installed state, interfering with a clean new installation attempt

The Fix

For the very common signature mismatch case (INSTALL_FAILED_UPDATE_INCOMPATIBLE), uninstall the existing app from the device before reinstalling, since Android has no mechanism to "update" an app installed with a different signing key — a full uninstall is required first:

adb uninstall com.yourapp.package
npx react-native run-android

Confirm exactly one device or emulator is connected and recognized, since ambiguity between multiple connected targets can also produce installation failures or unexpected behavior:

adb devices

If multiple devices are listed and you need to target a specific one, specify it explicitly:

npx react-native run-android --deviceId=<specific_device_id>

Check available storage on the target device or emulator, since an installation failing due to insufficient space sometimes produces a less-than-obvious error message rather than a clear "out of space" indication:

adb shell df /data

If storage is genuinely constrained (common on emulators with a small allocated disk image), free up space by removing unused apps or data on the emulator, or increase the emulator's allocated storage through its own configuration/AVD settings.

For a broken or partially-installed previous app state, a full uninstall followed by a device/emulator restart, then a fresh install, resolves most lingering inconsistent-state issues that a plain uninstall alone doesn't fully clear:

adb uninstall com.yourapp.package
adb reboot
# wait for device to fully restart, then:
npx react-native run-android

If you're specifically switching frequently between debug and release builds during development/testing and want to avoid the signature conflict recurring repeatedly, consider using distinct application IDs for debug versus release builds, so they're treated as genuinely separate apps that can coexist on the device without ever conflicting over a shared signature:

// android/app/build.gradle
android {
    buildTypes {
        debug {
            applicationIdSuffix ".debug"
        }
    }
}

This makes your debug build install as a genuinely separate app (with a package name like com.yourapp.debug) alongside any release build, eliminating the recurring signature conflict entirely for this specific development workflow pattern.

Still Not Working?

If the error message doesn't clearly indicate one of the above causes, run the install step with verbose Gradle output to get more detailed diagnostic information about exactly what's failing and why:

cd android
./gradlew installDebug --stacktrace --info

The much more verbose output here often surfaces a more specific underlying ADB or device-communication error that the default, more terse React Native CLI output summarizes away, giving you a more precise, actionable error message to work from rather than the generic task failure summary alone.