18

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
5
  • 1
    Check this answer: stackoverflow.com/a/49096658/3806413 Commented Mar 28, 2018 at 12:48
  • @0xalihn Thanks,You made my day. Commented Mar 29, 2018 at 10:43
  • Don't forget to upvote if it works. So that, others can be benefited. Commented Mar 29, 2018 at 10:44
  • Sorry i need 15 reputation to upvote comments. Commented Mar 29, 2018 at 11:04
  • This may be worth checking also - worked for me: stackoverflow.com/a/49510827/334402 Commented Jan 4, 2019 at 13:35

4 Answers 4

21

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

    repositories {
        mavenCentral() // <-- add this at top
        google()
        jcenter()
    }
Sign up to request clarification or add additional context in comments.

2 Comments

@IgorGanapolsky I dunno man but apparently it solved the issue for me and 8 other people who upvoted it? Technically it's because jCenter was overloaded, so moving it to the bottom and adding mavenCentral at the top makes Gradle look for it in mavenCentral first, and jCenter second. If it's not overloaded at the time, the order shouldn't affect anything, though. If this is not the cause, I'd put my wager on implementation vs api in Gradle build dependency.
This is solved my problem, thank you @EpicPandaForce for that great answer. By the way my problem was - problem occurred configuring root project could not get resource kotlin plugin 1.3.0 on Android Studio 3.2.1
7

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'
    }
}

Comments

6

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()
    }
}

Comments

3

Add the following to your Project gradle file:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
    }
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.