Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 4.2 Kotlin Plugin Issue

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

like image 262
Ibrahim Disouki Avatar asked May 05 '21 12:05

Ibrahim Disouki


People also ask

How do I downgrade my Kotlin plugin?

To downgrade the plugin, you need to uninstall it, download the 1.0. 6 version corresponding to your IDE version as a file from plugins.jetbrains.com and install it using the “Install plugin from disk” button. The lack of support for downgrading plugins is a limitation of the IntelliJ Platform at this time.


Video Answer


3 Answers

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.

like image 191
sangavi Avatar answered Oct 13 '22 07:10

sangavi


This is a known bug:

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

"the problem will be fixed in 1.5.10 update"

like image 6
John Glen Avatar answered Oct 13 '22 07:10

John Glen


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.

like image 3
roflcopter1101 Avatar answered Oct 13 '22 07:10

roflcopter1101