问题
I updated my AS from 3.0 to 3.1. After fixing several issues that showed up with the update, I am stuck at making Kotlin work.
Kotlin code compiles and runs, although I can't edit kotlin files. Kotlin keywords are not recognised by the editor, using kotlin code from java classes appear red and in general I can't really do anything with kotlin.
I use:
buildscript {
ext.kotlin_version = '1.2.41'
...
...
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:3.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
kotlin plugin: 1.2.41-release-Studio3.1-1
and org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version
来源:https://stackoverflow.com/questions/50098853/android-studio-3-1-kotlin-plugin-does-not-work