Kotlin plugin should be enabled before ‘kotlin-kapt’

We faced this issue when we updated Android Studio to the latest version 3.5 at the time of writing this tutorial. You would see the line “Kotlin plugin should be enabled before ‘kotlin-kapt’” in Run window when you run your Android Application.

image 750x 5ede1f305d59c - Kotlin plugin should be enabled before ‘kotlin-kapt’
Kotlin plugin should be enabled before ‘kotlin-kapt’

We faced this issue when we updated Android Studio to the latest version 3.5 at the time of writing this tutorial.

You would see the line “Kotlin plugin should be enabled before ‘kotlin-kapt’” in Run window when you run your Android Application.

kotlin plugin should ne enabled before kotlin kapt - Kotlin plugin should be enabled before ‘kotlin-kapt’

Solution

As the message says, all you have to do is you have to enable Kotlin plugin before kotlin-kapt in appbuild.gradle.

The plugin contents of appbuild.gradle file before solving this issue is shown below.

appbuild.gradle

app build gradle previous - Kotlin plugin should be enabled before ‘kotlin-kapt’

Now we will change the order of kotlin-kapt and kotlin-android with kotlin-android coming prior to kotlin-apt.

app build gradle after solving issue - Kotlin plugin should be enabled before ‘kotlin-kapt’

Now, when you run your application, you should not see this warning message.

kotlin plugin should ne enabled before kotlin kapt solved - Kotlin plugin should be enabled before ‘kotlin-kapt’