Android Studio will not install the app: the device's Android version is too old
Failure [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.
Fix it fast
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*2Match what you see, then jump to its fix
- 1
Failure [INSTALL_FAILED_OLDER_SDK] on one device while another device installs fineminSdk is higher than the device's API levelFix - 2
The error appears only on one AVDThe emulator image has a lower API level than the app requiresFix - 3
You changed minSdkVersion in AndroidManifest.xml and nothing changedminSdk is set in the manifest and in Gradle, and they disagreeFix
- 1
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 installDebugConfirmed by developer.android.com
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 avd2Fix
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 selectedConfirmed by developer.android.com
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 assembleDebugConfirmed by developer.android.com
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
adb cannot start because something already holds its port
adb start-server failed
The adb server must bind local TCP port 5037, and every adb client talks to it there.
2 causes, each with a fixMobile apps
The phone shows as unauthorized and Android Studio will not run the app
adb devices lists the phone but Android Studio cannot deploy to it
An unauthorized phone means it has not trusted this computer's RSA key.
3 causes, each with a fixMobile 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 fixMobile apps
adb cannot connect to its daemon or start the server
* daemon started successfully *
The adb server is a background process on your computer that listens on TCP port 5037.
2 causes, each with a fixMobile apps
adb prints 'server version doesn't match this client; killing...'
adb server version doesn't match this client; killing...
adb runs a background server, and every adb command is a client.
3 causes, each with a fixMobile 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