How to switch between multiple versions of Kotlin?

Viewed 416

I need to provide maintenance support for the "legacy" mobile App, while also providing enhanced feature support to the "next major version" of this mobile App. To do it efficiently, I need to be able to switch between 1.3.x and 1.4.x of the Kotlin compiler. Everything that I am reading, implies that Kotlin only moves forward, so I hesitate to upgrade my version of Kotlin in Android Studio to get 1.4.x plugin installed without the confidence that I can switch back to 1.3.x.

It looks like a simple change in the Gradle build scripts should work, but it is not clear that changing the version changes all of the toolset, or simply tries to be backward compatible from a future-looking configuration.

1 Answers

You can update the Android Studio plugin safely - it should be backward compatible with the older versions of Kotlin.

If you want to change the compiler version (for using new language features), you should update the version in the Gradle script - you can change it whenever you want, the older versions of Kotlin libs and compiler are still available in the repositories.

I recommend you to always update Android Studio plugin to the latest version, so you have full Kotlin support in your IDE for all versions of the Kotlin compiler.

Related