32

Cannot build a new project using Android Studio 4.2 because of the following error:

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

When I changed the Kotlin plugin version from ext.kotlin_version = "1.5.0-release-764" to ext.kotlin_version = "1.5.0" app builds successfully but the following warning appears:

Kotlin version that is used for building with Gradle (1.5.0) differs from the one bundled into the IDE plugin (1.5.0-release-764) 

enter image description here

6
  • stackoverflow.com/questions/67400029/… Commented May 5, 2021 at 13:05
  • But I want to use the latest Kotlin version Commented May 5, 2021 at 13:33
  • 2
    As it is not released as a stable version yet, Kotlin 1.5 should be used in Android Studio Canary instead of the latest stable version Commented May 5, 2021 at 13:44
  • 1
    @Wang who said it's not stable? Where did you get this info? Commented May 6, 2021 at 12:20
  • I'm thinking this is a bug with the new release. Any time I got this warning, updating the version made the warning go away and I was at the latest stable version. This appears to be impossible with the new version, unless there is some missing gradle setting that is preventing it from finding the bundled version. Commented May 8, 2021 at 15:22

6 Answers 6

12

Change From

buildscript {
ext.kotlin_version = "1.5.0-release-764"
......}

Change To

buildscript {
ext.kotlin_version = "1.5.0"
....}

Change the Kotlin Version Issue will be cleared.

Sign up to request clarification or add additional context in comments.

1 Comment

I'm already mentioned that in the question but what about the warning!?
6

This is a known bug:

https://youtrack.jetbrains.com/issue/KTIJ-11590

"the problem will be fixed in 1.5.10 update"

Comments

3

I went to the build.gradle file and changed the ext.kotlin_version = "1.5.0" to ext.kotlin_version = "1.4.32", as that was the version of an older project which successfully built.

2 Comments

Again I want to use the latest stable version of Kotlin which is 1.5.0 Also, If I used this 1.4.32 warning still exists.
Well apparently 1.4.32 is the latest stable version lol 1.5.0 doesn't seem to be working right
2

I was using the same version of kotlin-gradle-plugin bundled with the IDE, which is 1.5.10, in Android studio 4.2.1, and for me disabling the 'Block connections to untrusted servers' in my anti-virus fixed the error.

Comments

0

According to Android Studio's message, Kotlin's latest stable version is 1.5.0-release-764. If you want to (or in this case I guess everyone needs to) use version 1.5.0:

  1. Go to Tools in the menu

  2. Go to Kotlin

  3. Choose Configure Kotlin Plugin Updates

  4. In the drop-down, choose the early access preview version of 1.5.x and then click OK.

Gradle sync will now configure the Studio with Kotlin 1.5.0.

enter image description here

1 Comment

This doesn't fix the warning
0

if you work on flutter project ,you just need to update flutter sdk run that command in terminal:

flutter upgrade

After updating , new flutter version will fix that errors automatically.

1 Comment

This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

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.