为你的项目添加kotlin插件
image.png在项目build.gradle中添加
buildscript {
repositories {
jcenter()
}
ext.kotlin_version = '1.1.2-3'
ext.anko_version='0.10.1'
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
在项目中的build.gradle添加
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile "org.jetbrains.anko:anko-common:$anko_version"
网友评论