Error:Failed to resolve: runtime/Failed to resolve: common

我的Android Studio 版本3.1.2;
编译环境:
classpath ‘com.android.tools.build:gradle:3.0.1’
distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip

在项目的build.gradle中添加如下代码:

allprojects {
    repositories {
        google()
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
        jcenter()

    }
}

https://stackoverflow.com/questions/50788647/errorfailed-to-resolve-runtime?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

调整项目build.gradle中的仓库顺序:
将 mavenCentral()放在jcenter()前面;
将 maven { url “maven.google.com”; }放在所有repositories前面;

https://stackoverflow.com/questions/50565776/build-gradle-error-failed-to-resolve-common

repositories 顺序不同编译会有什么不同?

点赞