Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The application's minSdkVersion is newer than the device API level (android-R)

I have a device with android version 10.

Also, I have an emulator with API 22

this is a part of my build.gradle(:app) file:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-kapt'

apply plugin: 'kotlin-android-extensions'

android {
    dataBinding {
        enabled = true
    }
    compileSdkVersion 'android-R'
    defaultConfig {
        applicationId "com.example.android.sOnline"
        minSdkVersion 17
        targetSdkVersion 'R'
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
//        android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
    }
}

It just not working on 'android-R'

Thank you for helping me :)

like image 686
hamid keyhani Avatar asked Apr 04 '20 00:04

hamid keyhani


People also ask

What is the latest API level?

Starting in November 2022, app updates must target API level 31 or above and adjust for behavioral changes in Android 12; except for Wear OS apps, which must target API level 30 or higher. Note: Starting in 2022, some out-of-date apps will be unavailable to new users of devices that run newer versions of Android.

What is the API level in Android?

What is API Level? API Level is an integer value that uniquely identifies the framework API revision offered by a version of the Android platform. The Android platform provides a framework API that applications can use to interact with the underlying Android system.

How do I update minSdkVersion?

To change Android minSdkVersion in Flutter for the project created after the 2.8 update, you have to make changes in the local. properties file and then reference the new variable from the local. properties file inside the build. gradle file.

Is API level and SDK version same?

The real difference is that an API is really just an interface for a service, while an SDK is the tools/components/code fragments that have been created for a specific purpose.


1 Answers

targetSdkVersion "R" will restrict your app to only running on Android R, by artificially raising your minSdkVersion to R. This has been the case for the past several years: each developer preview only supports running the app on the developer preview itself, not older devices.

Sometime later this year, we will be able to switch to using targetSdkVersion 30, at which point normal behavior returns with respect to minSdkVersion.

like image 175
CommonsWare Avatar answered Sep 21 '22 07:09

CommonsWare