Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
}
like image 751
papesky Avatar asked Jan 13 '18 16:01

papesky


People also ask

Could not resolve com Android tools build gradle 3.5 0 flutter?

This kind of issue usually appears either due to a gradle misconfig or in your case, it looks more of an internet issue. Try running flutter clean in your project source and then using flutter build appbundle and check whether you're able to run the command without any errors.


2 Answers

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

like image 88
papesky Avatar answered Sep 19 '22 14:09

papesky


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

enter image description here

like image 39
mehmoodnisar125 Avatar answered Sep 20 '22 14:09

mehmoodnisar125