minSdkVersion is newer than the device API Level error while installing app

3.5k Views Asked by At

I am installing Android app with target sdk version android S in Android phone with Api level 30. My default config settings for app is like

compileSdkVersion 'android-S'
buildToolsVersion "30.0.3"

defaultConfig {
    applicationId "com.example.test"
    minSdkVersion 21
    targetSdkVersion "S"
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

But when I install the apk in Emulator with Api Level 30 I am getting error as

Installation did not succeed.
The application could not be installed: INSTALL_FAILED_OLDER_SDK

The application's minSdkVersion is newer than the device API level.

How to resolve this ? Which things need to be modified to make it working ?

2

There are 2 best solutions below

3
blackapps On

targetSdkVersion "S"

Using a prelimary version the minSdkVersion becomes S too automatically.

0
Satyam Gondhale On

Changing to this version worked

compileSdkVersion 'android-S'
buildToolsVersion "30.0.3"

defaultConfig {
    applicationId "com.example.test"
    minSdkVersion 21
    targetSdkVersion 31
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}