Gradle error after update: com.android.tools:sdk-common

a 夏天 提交于 2019-12-09 14:21:49

问题


I updated Android Studio to the last version (3.1 Canary 8) and mandatorily the com.android.tools.build:gradle to version 3.1.0-alpha08, but syncing the project I get this error:

Could not find sdk-common.jar (com.android.tools:sdk-common:26.1.0-alpha08).
Searched in the following locations:
    https://maven.google.com/com/android/tools/sdk-common/26.1.0-alpha08/sdk-common-26.1.0-alpha08.jar

I searched around but not solution found, can someone help me solve this issue?

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0-alpha07'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.1.2'
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Thanks a lot in advance.

UPDATE: this is the new bukd.gradle (project):

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0-alpha08'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.1.2'
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

回答1:


For the sake of the knowledge ;) I fixed it by adding google() above jcenter() in the repositories block as suggested by the official documentation: developer.android.com/studio/build/index.html




回答2:


Please go to project gradle file and add google() above jcenter().



来源:https://stackoverflow.com/questions/48242111/gradle-error-after-update-com-android-toolssdk-common

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!