Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

299
Views
Can't create new Kotlin project after updating to Android Studio 4.2

I updated Android studio 4.2 but I wasn't able to create new project kotlin

A problem occurred configuring root project 'My Application'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0-release-764.
 Searched in the following locations:
   - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0-release- 
764/kotlin-gradle-plugin-1.5.0-release-764.pom
   - https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0-release-764/kotlin-gradle-plugin-1.5.0-release-764.pom
 Required by:
     project :

Possible solution:
- Declare repository providing the artifact, see the documentation at 
 https://docs.gradle.org/current/userguide/declaring_repositories.html
over 4 years ago · Santiago Trujillo
15 answers
Answer question

0

The error is clear Gradle was unable to find the library that you declared

Possible fixes

Location

Project -> build.gradle

//update it
dependencies {
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30"
}

Edited kotlin has released stable version of version 1.5.0 last night you can use this version to stay up-to-date

dependencies {
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0"
}
over 4 years ago · Santiago Trujillo Report

0

Worked for me:

Location: build.gradle

change

buildscript {
    ext.kotlin_version = "1.5.0-release-764"
    repositories {
        google()
        mavenCentral()
    }

to

buildscript {
    ext.kotlin_version = "1.5.0"
    repositories {
        google()
        mavenCentral()
    }
over 4 years ago · Santiago Trujillo Report

0

You should know that there are "two" build.gradle files in the Gradle Scripts on Android Studio, the build.gradle(Project) and build.gradle(Module). It took me hours to realize that I've been looking at the Module version of build.gradle while attempting to fix this and wasn't able to find the proper kotlin version variables to change.

build.gradle(Project) is the proper build.gradle you want to make changes to.

From there change

buildscript {
ext.kotlin_version = "1.5.0-release-764"
repositories {
    google()
    mavenCentral()
}

to

buildscript {
ext.kotlin_version = "1.5.0"
repositories {
    google()
    mavenCentral()
}

and try to rebuild your project again. This should work.

over 4 years ago · Santiago Trujillo Report

0

On new project create

buildscript {        ext.kotlin_version = "1.5.0-release-764"
        repositories {
            google()
            mavenCentral()
        }

this is work for me

buildscript {
    ext.kotlin_version = "1.4.30"
    repositories {
        google()
        mavenCentral()
    }
over 4 years ago · Santiago Trujillo Report

0

Change From

    buildscript {
    ext.kotlin_version = "1.5.0-release-764" //Remove release-764
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.0"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

    }
}

Change To

 buildscript {
    ext.kotlin_version = "1.5.0" //Here is the change have to add this Version 
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.0"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

    }
}
over 4 years ago · Santiago Trujillo Report

0

Add this dependency into your build.gradle

 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0"
over 4 years ago · Santiago Trujillo Report

0

If you want a fast solution, just select 1.4.32 Kotlin version when Android Studio prompt configure Kotlin window.

At this time - May 13, 2021 - selecting 1.5.0 its giving me gradle issues

over 4 years ago · Santiago Trujillo Report

0

When ever I started creating a new project this error occurs with the gradle plugin.

UPDATE 14th May 2021 ->

GOTO -> gradle -> build.gradle -> in the code -> dependencies -> Change Classpath -> classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0"

and you're good to go.

over 4 years ago · Santiago Trujillo Report

0

Please update your Android Studio to 4.2.1(Released on May 13, 2021), the new Stable Version. This issue has been resolved in that:-

Kotlin Issue #187403740: Android Studio 4.2.0 generates projects with the wrong Kotlin version: "1.5.0-release-764"

Change Log

https://androidstudio.googleblog.com/2021/05/android-studio-421-available.html

over 4 years ago · Santiago Trujillo Report

0

New Android Studio 4.2.1 has been released with Patches.

If upgrading does not fix your issues, Try Restart and reset caches.

Otherwise use the solution provided above which is to replace in build.gradle

from

ext.kotlin_version = "1.5.0-release-764"

to

ext.kotlin_version = "1.5.0"
over 4 years ago · Santiago Trujillo Report

0

SIMPLEST SOLUTION FOR YOUR PROBLEM:

change :

ext.kotlin_version = "1.5.0-release-764"

to :

ext.kotlin_version = "1.5.0"

in your build.gradle project level

over 4 years ago · Santiago Trujillo Report

0

As everybody now knows the solution, we have to get rid of -release-764 as there is no such artifact with this version.

The same can be validated below

https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-gradle-plugin

I just wanted to add a few pointers, whenever you get any such error(Could not resolve all artifacts for any library Could not find xyz) in future for any of the android's library.

Most of the library we use are resolved by

  • google()
  • mavenCentral()

If its a Google's Android library

  • Search google's maven repo https://maven.google.com/ to see if the version you are looking for is even the correct one or what is the latest version of the library exists.
  • Few of the google's android library is still available at mavenCentral, you can use https://mvnrepository.com/ or https://search.maven.org/ to search or validate the version of your library

If it's another android library and you haven't specified any specific repositories for them apart from mavenCentral() then you can use https://mvnrepository.com/ or https://search.maven.org/ to search or validate the version of your library

If in case you are using maven { url 'https://jitpack.io' } as a repository for your library then you can search here https://jitpack.io/.

Hopefully, these pointers will be of any use to someone, this always helps me in case I am getting any such error.

over 4 years ago · Santiago Trujillo Report

0

Change the dependency

ext.kotlin_version = "1.5.0-release-764"
   dependencies {
       classpath "com.android.tools.build:gradle:4.2.0"
       classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
   }

To this

ext.kotlin_version = "1.5.10"
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.1"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"     
    }
over 4 years ago · Santiago Trujillo Report

0

If anyone was facing a similar issues for a Java project then Here is a sample build.gradle file (Project Level)

Caution: Notice the mavenCentral() method added there, this is a must to be added for gradle 4.2.1+

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.google.gms:google-services:4.3.8'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.0'
        classpath 'com.android.tools.build:gradle:4.2.1'
    }
}


allprojects {
    repositories {


        mavenCentral()
        maven {
            url "https://maven.google.com/"
        }

        google()

        maven() {
            url "https://oss.sonatype.org/content/repositories/snapshots"
        }

        jcenter()

        maven { url 'https://jitpack.io' }


    }
}

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

over 4 years ago · Santiago Trujillo Report

0

In my case this was easily resolved by replacing jcenter() with mavenCentral() in the buildscript and allprojects repositories for build.grade.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!