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

Android Studio Gradle Build失败 – 要求提供不存在的sdk版本,第1张

概述24小时前我的项目完美构建,没有错误.在不更改单个代码的情况下,当我恢复工作时,它将不再构建. 签出旧的工作提交现在会产生相同的错误. 这些是我得到的错误代码: Information:Gradle tasks [assemble]Error:(9, 5) error: resource android:attr/dialogCornerRadius not found./home/liam/ 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工作室说这个包不可用/不存在下载.

How to find issue Android SDK 3.0 Error:(9,5) error: resource android:attr/colorError not found

单击前面提到的错误代码会打开一个名为v28 / values-v28.xml的文件.

<?xml version="1.0" enCoding="utf-8"?><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></resources>

这是我的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}
解决方法 您在build.gradle中有设计lib版本,这意味着它将下载最新版本.所以请将它设置为26.1.0,它应该工作.支持28是Alpha版本,昨天发布了新的AndroID P预览版 总结

以上是内存溢出为你收集整理的Android Studio Gradle Build失败 – 要求提供不存在的sdk版本全部内容,希望文章能够帮你解决Android Studio Gradle Build失败 – 要求提供不存在的sdk版本所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1131246.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存