android sdk v28,Android Studio Gradle Build失败 – 要求提供不存在的sdk版本
24小時(shí)前我的項(xiàng)目完美構(gòu)建,沒有錯誤.在不更改單個代碼的情況下,當(dāng)我恢復(fù)工作時(shí),它將不再構(gòu)建.
簽出舊的工作提交現(xiàn)在會產(chǎn)生相同的錯誤.
這些是我得到的錯誤代碼:
Information:Gradle tasks [assemble]
Error:(9,5) error: resource android:attr/dialogCornerRadius not found.
/home/liam/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0-alpha1.aar/536e4dd78846259cf8bef0fd6a3ea0e6/res/values/values.xml
我認(rèn)為這是由Android P發(fā)布和我的Android Studio自動升級或類似的東西引起的.這可以解釋為什么有效的舊提交會得到同樣的錯誤.
這將是一個非常新的問題,這可以解釋為什么我還沒有找到解決方案.
搜索這些錯誤代碼會導(dǎo)致類似的問題,可以通過更改gradle構(gòu)建文件中的SDK版本來解決.我的問題與此不同,因?yàn)楦臑镾DK 28(我很確定28甚至不存在)導(dǎo)致android工作室說這個包不可用/不存在下載.
單擊前面提到的錯誤代碼會打開一個名為v28 / values-v28.xml的文件.
?android:attr/dialogCornerRadius
?android:attr/dialogCornerRadius
這是我的gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.timelord.timelord.timelord"
minSdkVersion 24
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs',include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation files('libs/joda-time-2.9.9.jar')
}
和
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
總結(jié)
以上是生活随笔為你收集整理的android sdk v28,Android Studio Gradle Build失败 – 要求提供不存在的sdk版本的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android动态更改布局宽高,动态更改
- 下一篇: android 前摄屏幕补光,异形显示屏