【问题标题】:Error changing build sdk in adroid studio在android studio中更改构建sdk时出错
【发布时间】:2020-01-09 03:10:04
【问题描述】:

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

AAPT:错误:找不到资源 android:attr/dialogCornerRadius。

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'
}

【问题讨论】:

  • 它可能不是这个,但以防万一,请转到源并检查具有dialogCornerRadius 的资源是否在正确的目录中。我很久以前也遇到过类似的错误,就是因为这个

标签: java android sdk dependencies targetsdkversion


【解决方案1】:
change sdk version like below and sync project

compileSdkVersion 29
minSdkVersion 15
targetSdkVersion 29

【讨论】:

    猜你喜欢
    • 2019-01-02
    • 2017-09-27
    • 1970-01-01
    • 2022-10-25
    • 1970-01-01
    • 2020-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多