android sdk v28,Android Studio Gradle Build失败 – 要求提供不存在的sdk版本

24小时前我的项目完美构建,没有错误.在不更改单个代码的情况下,当我恢复工作时,它将不再构建.

签出旧的工作提交现在会产生相同的错误.

这些是我得到的错误代码:

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

我认为这是由Android P发布和我的Android Studio自动升级或类似的东西引起的.这可以解释为什么有效的旧提交会得到同样的错误.

这将是一个非常新的问题,这可以解释为什么我还没有找到解决方案.

搜索这些错误代码会导致类似的问题,可以通过更改gradle构建文件中的SDK版本来解决.我的问题与此不同,因为更改为SDK 28(我很确定28甚至不存在)导致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

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值