Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After update to Android Studio 3.1 I'm facing this error: Could not find org.jetbrains.kotlin:kotlin-stdlib-jre8:1.2.0

After updating to Android Studio 3.1, I'm facing this error.

Note: I'm using Java not Kotlin

Could not find org.jetbrains.kotlin:kotlin-stdlib-jre8:1.2.0.

Searched in the following locations:
    https://maven.fabric.io/public/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.2.0/kotlin-stdlib-jre8-1.2.0.pom
    https://maven.fabric.io/public/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.2.0/kotlin-stdlib-jre8-1.2.0.jar
    https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.2.0/kotlin-stdlib-jre8-1.2.0.pom
    https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.2.0/kotlin-stdlib-jre8-1.2.0.jar
Required by:
    project :app > com.android.tools.build:gradle:3.1.0 > com.android.tools.build:gradle-core:3.1.0
    project :app > com.android.tools.build:gradle:3.1.0 > com.android.tools.build:gradle-core:3.1.0 > com.android.tools.build:builder:3.1.0
    project :app > com.android.tools.build:gradle:3.1.0 > com.android.tools.build:gradle-core:3.1.0 > com.android.tools.lint:lint-gradle-api:26.1.0
    project :app > com.android.tools.build:gradle:3.1.0 > com.android.tools.build:gradle-core:3.1.0 > com.android.tools.build:gradle-api:3.1.0
    project :app > com.android.tools.build:gradle:3.1.0 > com.android.tools.build:gradle-core:3.1.0 > com.android.databinding:compilerCommon:3.1.0
    project :app > com.android.tools.build:gradle:3.1.0 > com.android.tools.build:gradle-core:3.1.0 > com.android.tools.build:builder:3.1.0 > com.android.tools:sdk-common:26.1.0
    project :app > com.android.tools.build:gradle:3.1.0 > com.android.tools.build:gradle-core:3.1.0 > com.android.tools.build:builder:3.1.0 > com.android.tools.build:manifest-merger:26.1.0
    project :app > com.android.tools.build:gradle:3.1.0 > com.android.tools.build:gradle-core:3.1.0 > com.android.tools.build:builder:3.1.0 > com.android.tools:sdklib:26.1.0 > com.android.tools:repository:26.1.0
like image 988
Mohamed Ramadan Avatar asked Mar 28 '18 12:03

Mohamed Ramadan


3 Answers

JCenter was being cranky the other day, so following should help:

    repositories {
        mavenCentral() // <-- add this at top
        google()
        jcenter()
    }
like image 186
EpicPandaForce Avatar answered Oct 10 '22 10:10

EpicPandaForce


Add the JCenter repo to your Project-level build.gradle file:

buildscript {
    dependencies {
        repositories {
            //...
            google()
            jcenter() // <--- this is needed
        }

        classpath 'com.android.tools.build:gradle:3.1.0'
    }
}
like image 34
Christoph Avatar answered Oct 10 '22 09:10

Christoph


Working like this

buildscript {
    ext.kotlin_version = '1.1.1'  //Add this line
    repositories {
        jcenter()
        google()
    }
    dependencies {

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

allprojects {
    repositories {
        jcenter()
        google()
    }
}
like image 26
Mohamed Ramadan Avatar answered Oct 10 '22 09:10

Mohamed Ramadan