android - 无法升级到最新的支持库Android Studio

标签 android gradle build.gradle android-support-library android-8.0-oreo

我已经安装了最新版本的Android支持存储库(47.0.0),但是由于出现以下错误而无法构建我的项目。

ERROR

这是我的build.gardle代码

compileSdkVersion 26
buildToolsVersion '26.0.1'
defaultConfig {
    applicationId "ir.dones.dones"
    minSdkVersion 17
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary= true
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}


compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

依存关系
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.3-alpha', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:support-compat:26.0.0'
implementation 'com.android.support:support-v4:26.0.0'
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support:support-core-utils:26.0.0'
implementation 'com.android.support:design:26.0.0'
implementation 'com.android.support:support-vector-drawable:26.0.0'
implementation 'com.android.support:recyclerview-v7:26.0.0'
implementation 'com.android.support:cardview-v7:26.0.0'
implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation 'com.google.code.gson:gson:2.8.1'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation "at.blogc:expandabletextview:1.0.3"
testImplementation "junit:junit:4.12"

我已经完成了Android Studio建议将支持库升级到26.0.2版本的建议,但是据我所知,还没有发布这样的版本。

Android Studio suggestion

再次这样做,我遇到了同样的错误。我在存储库中尝试了google()和maven(),但均无济于事。将支持版本更改为26. +是构建项目的唯一方法,但这种方式无法使用Aml <26的Xml中的字体等新功能。

我正在使用Android Studio Canary 8。

任何帮助,将不胜感激。

最佳答案

检查您的build.gradle。您应该拥有Google存储库:

allprojects {
    repositories {
        google()
        jcenter()
    }
}

关于android - 无法升级到最新的支持库Android Studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45410761/

相关文章:

android - 使用 SAX 从 RSS 描述标签解析 img

android - 在使用构建类型和产品风格时如何包含 LeakCanary?

android - 无法解析符号Firebase

android - Flutter Android Studio Failed to resolve : androidx. legacy :legacy-support-v4:27. 0.1错误

java - 如何将数组和字符串一起保存到一个紧凑的包中

android - 使用 CSV/TXT 文件中的名称列表(带有属性)动态生成 productFlavors 和 sourceSets

android - 如何为 Spinner 的下拉菜单设置不同的主题?

java - IntelliJ + Gradle + JavaFX 构建,但未运行

Android Studio Gradle 构建错误 java.io.IOException Could not delete path

android - Build.gradle:对 'project' 的访问超出了其访问权限