Maaz Zindani

Loading the index…

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

Android Studio will not install the app: the device's Android version is too old

ErrorFailure [INSTALL_FAILED_OLDER_SDK]

Short answer

The system refuses to install an app when its minSdk is higher than the API level of the device or emulator. Compare the two numbers. Then either lower minSdk in the Gradle build file, if your code does not need newer APIs, or run on a device or emulator image with a higher API level.

  • Applies to Android Gradle Plugin 8, Android Studio, API 24 to 36 devices
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Read minSdk from the Gradle file, then compare it with the API level of the device or emulator you are running on (the table in the Android docs maps Android versions to API levels).

    grep -rn "minSdk" app/build.gradle*
  2. 2Match what you see, then jump to its fix

    1. 1Failure [INSTALL_FAILED_OLDER_SDK] on one device while another device installs fineminSdk is higher than the device's API levelFix
    2. 2The error appears only on one AVDThe emulator image has a lower API level than the app requiresFix
    3. 3You changed minSdkVersion in AndroidManifest.xml and nothing changedminSdk is set in the manifest and in Gradle, and they disagreeFix

What does the error look like?

  • Failure [INSTALL_FAILED_OLDER_SDK]
  • INSTALL_FAILED_OLDER_SDK

Cause 1 of 3

minSdk is higher than the device's API level

1Check

The system blocks the install when the app's minSdk is greater than the system's API level. Check the value in defaultConfig and in any product flavor that overrides it.

grep -rn -B1 -A1 "minSdk" app/build.gradle*

2Fix

If your code runs on older versions, lower minSdk to the lowest API level you support. If you use newer APIs, keep it and test on a newer device instead.

android {
    defaultConfig {
        minSdk = 24
    }
}

3Verify

Sync Gradle and install again.

./gradlew installDebug

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 3

The emulator image has a lower API level than the app requires

1Check

An app does not run on a system image with an API level lower than the minSdk the app declares.

avdmanager list avd

2Fix

Create an AVD from a system image whose API level is equal to or higher than minSdk, in Device Manager.

avdmanager create avd -n api34 -k "system-images;android-34;google_apis;x86_64"

3Verify

Run the app on the new AVD.

# Run in Android Studio with api34 selected

Confirmed by developer.android.com

Did this fix it?

Cause 3 of 3

minSdk is set in the manifest and in Gradle, and they disagree

1Check

Settings in the Gradle build files override the uses-sdk element in the manifest.

grep -n "uses-sdk" app/src/main/AndroidManifest.xml
grep -n "minSdk" app/build.gradle*

2Fix

Remove the attributes from the uses-sdk element and define minSdk only in the Gradle build file.

<!-- AndroidManifest.xml: delete the android:minSdkVersion attribute -->

3Verify

Build again; the merged minSdk is the value from Gradle.

./gradlew assembleDebug

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • Define minSdk in one place, the Gradle defaultConfig.
  • Keep an emulator at your minSdk level and one at the latest level.
  • Check the minSdk of new libraries before adding them.

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

Android Studio cannot pair the phone over Wi-Fi

The Pair devices over Wi-Fi dialog lists no device

Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.

4 causes, each with a fix

Mobile apps

adb tcpip 5555 fails because no device is found

adb: more than one device/emulator

adb tcpip only works while the device is attached and listed by adb, because it tells the phone to start listening on port 5555.

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.