Android – Outdated Kotlin Runtime warning in Android Studio

androidandroid-studiokotlinkotlin-android-extensions

After downloaded and installed latest Kotlin plugin I have Outdated Kotlin Runtime warning from Android Studio that telling me:

Your version of Kotlin runtime in 'kotlin-stdlib-1.1.2' library is
1.1.2, while plugin version is 1.1.2-release-Studio2.3-3. Runtime library should be updated to avoid compatibility problems.

I tried to click Update Runtime button but getting another message:

Automatic library version update for Gradle projects is currently
unsupported. Please update your build.gradle manually.

How to solve this issue?

Best Answer

You can update your Kotlin version in your project level build.gradle file. If you have it configured the usual way, you should have the following line in it around the top:

ext.kotlin_version = '1.1.2'

To upgrade to the version matching your plugin, simply change this line to:

ext.kotlin_version = '1.1.2-3'

Edit (to respond to a question below):

The error tells you that you need to upgrade your version, the question is where to find out that you have to put in 1.1.2-3 instead of saying, for example, 1.1.2-release-Studio2.3-3.

The best way to find out the latest version of Kotlin is by going to kotlinlang.org and looking for "Latest version". Should be right there on the front page.

Another thing to do if the version number is non-trivial like this is to check the repositories where the versions are hosted. In the case of Android, you'll probably be getting it from jcenter, for which you can find the repository page, which has all the available versions listed.

You can also browse the raw maven repository of jcenter where the files are actually hosted by going here, or look up Kotlin either on mvnrepository or on mavencentral (raw version of the latter here).