1. 程式人生 > >Failed to resolve: com.android.support:appcompat-v7:27.+ 報錯解決方法

Failed to resolve: com.android.support:appcompat-v7:27.+ 報錯解決方法

app module build.gradle dependencies中預設配置如下:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:27.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' }

Studio 2.3版本應該在Root Project build.gradle allprojects配置如下:

allprojects {
    repositories {
        jcenter()
        maven { url "https://maven.google.com" }
    }
}

Studio 3.0版本應該在Root Project build.gradle allprojects配置如下:

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