0

在此处输入图像描述 我是新手KotlinAndroid Studio但至少我按照 JetBrains 网站上的说明进行设置,但我一直在与这些错误作斗争:

Error:(16, 0) Extension with name 'android' does not exist. 
Currently registered extension names: [ext, kotlin]
4

3 回答 3

2

请参阅https://kotlinlang.org/docs/reference/using-gradle.html#targeting-android

buildscript {
    ext.kotlin_version = '<version to use>'

    ...

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

看起来你错过了

    apply plugin: 'com.android.application'
于 2017-07-20T08:40:48.530 回答
-1

Android Studio 2.3.3 不支持 kotlin sdk 下载android studio 3.0


https://developer.android.com/studio/preview/index.html
于 2017-07-20T08:53:54.170 回答
-2

谷歌正式宣布 Kotlin 支持 Android Studio 3.0 +。Android Studio 3.0 在Canary 频道中可用。尝试使用 Android Studio 3.0 Canary 以获得对Kotlin Android语言的适当支持和易用性。

于 2017-07-20T11:29:42.253 回答