在 Android Studio 中更改构建 sdk 时出错

问题描述 投票:0回答:1

当我将targetSdkVersion 和compileSdkVersion 都更改为26 时,出现错误。我尝试通过项目结构设置和手动更改它,但它一直给我以下错误:

AAPT:错误:找不到资源 android:attr/dialogCornerRadius。 error dialogCirnerRadius not found

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.agriplanner3"
        minSdkVersion 14
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}
repositories {
    google()
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.android.support:appcompat-v7:26.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
java android sdk dependencies targetsdkversion
1个回答
0
投票
change sdk version like below and sync project

compileSdkVersion 29
minSdkVersion 15
targetSdkVersion 29
© www.soinside.com 2019 - 2024. All rights reserved.