Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Extension with name 'android' does not exist" error when adding Kotlin to Android project

Tags:

android

kotlin

When I try to add Kotlin to our Android project using the official Kotlin tutorial, Gradle fails launching the error Extension with name 'android' does not exist.

like image 313
Roc Boronat Avatar asked Feb 10 '17 11:02

Roc Boronat


1 Answers

Android Studio modifies your build.gradle adding apply plugin: 'kotlin-android' above apply plugin: 'com.android.application'. Just move the Kotlin line below the Android one and Gradle will run smoothly. It should look like this example:

apply plugin: 'com.android.application' apply plugin: 'kotlin-android' 
like image 163
Roc Boronat Avatar answered Sep 20 '22 16:09

Roc Boronat