在android中,我正在开发一个应用程序,当我想将编译器版本更改为26时,它会给出以下错误:
5-8: 13: AAPT: error: resource : attr / dialogCornerRadius未找到。
使用将我发送到以下代码的链接:
<resources>
<style name="Base.Theme.AppCompat" parent="Base.V28.Theme.AppCompat"/>
<style name="Base.Theme.AppCompat.Light" parent="Base.V28.Theme.AppCompat.Light"/>
<style name="Base.V28.Theme.AppCompat" parent="Base.V26.Theme.AppCompat">
<!-- We can use the platform styles on API 28+ -->
<item name="dialogCornerRadius">?android:attr/dialogCornerRadius</item>
</style>
<style name="Base.V28.Theme.AppCompat.Light" parent="Base.V26.Theme.AppCompat.Light">
<!-- We can use the platform styles on API 28+ -->
<item name="dialogCornerRadius">?android:attr/dialogCornerRadius</item>
</style>
我的应用程序文件代码:
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.example.ocr"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}依赖关系:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
//image crop library
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
//image to text google library
implementation 'com.google.android.gms:play-services-vision:19.0.0'
}发布于 2019-12-19 12:46:24
5-8: 13: AAPT: error: resource : attr / dialogCornerRadius未找到。
您应该使用compileSdkVersion 28。
android {
compileSdkVersion 28
buildToolsVersion 28.0.3
defaultConfig {
targetSdkVersion 28
}
}https://stackoverflow.com/questions/59409768
复制相似问题