How to configure Kotlin version in Android Studio?-ThrowExceptions

Exception or error:

I have configured the Kotlin version in project’s build.gradle. But in Other Settings->Kotlin Compiler , it shows an older version.
How to fix that?

project's build.gradle

Android Studio's Settings

How to solve:

It is not showing you outdated version. Let’s say your plugin version is ‘1.1.3’, so your compiler version is ‘1.1’ not ‘1.1.3’. Now, if you will update your kotlin by going in

Tools > Kotlin > Configure Kotlin Updates

to early access version ‘1.2’ as shown in screenshot below, you will be able to see ‘1.2’ in you ‘Kotlin compiler’ settings.

enter image description here

###

In your Android studio,
Go to Tools -> Kotlin -> Configure Kotlin Updates.

For more details you can check
https://segunfamisa.com/posts/setting-up-android-studio-for-kotlin-development

###

Open you project gradle and add this line

 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.3-2"

After configuration project Gradle you need to add app Gradle. add kotlin plugin after android plugin like this

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

And the Last step add dependencies

   compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3-2"

And Click SYNC Project.

Leave a Reply

Your email address will not be published. Required fields are marked *