What's new in Kotlin 2.0.0-Beta1
The Kotlin 2.0.0-Beta1 release is out! It mostly covers stabilization of the new Kotlin K2 compiler, which reached its Beta status for all targets since 1.9.20.
IDE support
The Kotlin plugins that support 2.0.0-Beta1 are bundled in the latest IntelliJ IDEA and Android Studio. You don’t need to update the Kotlin plugin in your IDE. All you need to do is to change the Kotlin version to 2.0.0-Beta1 in your build scripts.
Kotlin K2 compiler
The JetBrains team is still working on stabilization of the new Kotlin K2 compiler. The new Kotlin K2 compiler will bring major performance improvements, speed up new language feature development, unify all platforms that Kotlin supports, and provide a better architecture for multiplatform projects.
The K2 compiler is in Beta for all target platforms: JVM, Native, Wasm, and JS. The JetBrains team has ensured the quality of the new compiler by successfully compiling dozens of user and internal projects. A large number of users are also involved in the stabilization process, trying the new K2 compiler in their projects and reporting any problems they find.
What to expect from upcoming Kotlin EAP releases
The upcoming 2.0.0-Beta2 and 2.0.0-Beta3 releases will introduce increased stability to the K2 compiler. If you are currently using K2 in your project, we encourage you to stay updated on Kotlin releases and experiment with the updated K2 compiler. Share your feedback on using Kotlin K2.
Current K2 compiler limitations
Enabling K2 in your Gradle project comes with certain limitations that can affect projects using Gradle versions below 8.3 in the following cases:
Compilation of source code from
buildSrc
.Compilation of Gradle plugins in included builds.
Compilation of other Gradle plugins if they are used in projects with Gradle versions below 8.3.
Building Gradle plugin dependencies.
If you encounter any of the problems mentioned above, you can take the following steps to address them:
Set the language version for
buildSrc
, any Gradle plugins, and their dependencies:kotlin { compilerOptions { languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9) apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9) } }Update the Gradle version in your project to 8.3 when it becomes available.
Compiler plugins support
Currently, the Kotlin K2 compiler supports the following plugins:
How to enable the Kotlin K2 compiler
Starting with Kotlin 2.0.0-Beta1, the Kotlin K2 compiler is enabled by default. No additional actions are required.
Leave your feedback on the new K2 compiler
We would appreciate any feedback you may have!
Provide your feedback directly to K2 developers on Kotlin Slack – get an invite and join the #k2-early-adopters channel.
Report any problems you faced with the new K2 compiler on our issue tracker.
Enable the Send usage statistics option to allow JetBrains to collect anonymous data about K2 usage.
How to update to Kotlin 2.0.0-Beta1
Starting from Kotlin 2.0.0-Beta1, the IntelliJ Kotlin plugin is distributed as a bundled plugin only. This means that you can’t install the plugin from JetBrains Marketplace anymore. With this change you will receive more frequent updates, ensuring that the latest stable IntelliJ IDEA and Android Studio versions consistently support the Kotlin versions that are released. The bundled plugin supports upcoming Kotlin EAP releases.
To update to the new Kotlin EAP version, change the Kotlin version to 2.0.0-Beta1 in your build scripts.