Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.31

I want to update the Android Gradle plugin but Im getting this error:

ERROR: Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.31.


Those are the lines I added to update the Android Gradle plugin (build.gradle file):

buildscript {
    repositories {
        // Gradle 4.1 and higher include support for Google's Maven repo using
        // the google() method. And you need to include this repo to download
        // Android Gradle plugin 3.0.0 or higher.
        google()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
    }
}

like image 673
allesuah Avatar asked Dec 10 '22 03:12

allesuah


1 Answers

You are missing some repositories(jcenter) and some dependencies(kotlin-gradle-plugin). That's why Kotlin cannot be found.

Your build.gradle(Project:android) file should look something like this:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:3.4.1"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}
like image 86
AlexTa Avatar answered Feb 13 '23 04:02

AlexTa