. Advertisement .
..3..
. Advertisement .
..4..
Android Studio 4.2 has introduced a lot of new features for Android development, but there’s one issue with the new tooling that may affect you. As of now, the new tooling is not compatible with Kotlin. In case you’re getting the error, “Can’t create new Kotlin project after updating to Android Studio 4.2“, then here are some possible workarounds.
How To Deal With The Error “Can’t create new Kotlin project after updating to Android Studio 4.2”?
After upgrading your Android Studio, I might have difficulty creating a project.
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
The error is fairly straightforward. The issue is that Gradle was unable to locate the library you specified. To fix this error, go to Project => build.gradle and change the line below.
Option 1: Upgrade Gradle
The error is fairly straightforward. The issue is that Gradle was unable to locate the library you specified. To fix this error, go to Project => build.gradle and change the line below.
dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30" }
Option 2: Upgrade version
It’s also possible that the Kotlin version is a problem. As a result, I simply removed the Kotlin extensioln version. As seen below:
Before:
buildscript { ext.kotlin_version = "1.5.0-release-764" repositories { google() mavenCentral() }
After:
buildscript { ext.kotlin_version = "1.5.0" repositories { google() mavenCentral() }
Conclusion
We hope you enjoyed our article about dealing with the error “Can’t create new Kotlin project after updating to Android Studio 4.2”. We are confident that you will make the most of your Java development experience with this information.
If you still have any further concerns or problems, please feel free to leave us comments. Thank you for reading; please make sure to share this helpful article with others!
Leave a comment