小编ham*_*ani的帖子

应用程序的 minSdkVersion 比设备 API 级别 (android-R) 新

我有一台 android 版本 10 的设备。

另外,我有一个带有 API 22 的模拟器

这是我的 build.gradle(:app) 文件的一部分:

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
    }
}
Run Code Online (Sandbox Code Playgroud)

它只是不适用于“android-R”

感谢你们对我的帮助 :)

android android-emulator android-studio-4.0 android-11

7
推荐指数
1
解决办法
4491
查看次数