-Android Studio 1.5.1,Java 1.7.0 amd64,Ubuntu 15.10
-instaled kotlin-plugin 1.0.0
创建空活动的新项目(API级别15)
-Tools-> Kotlin->在项目中配置Kotlin
-Default选项被选中,所有模块,Kotlin插件版本1.0.0
生成build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "kotlin.org.jjvr.kotlinapplication"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
buildscript {
ext.kotlin_version = '1.0.0'
repositories {
mavenCentral()
} …Run Code Online (Sandbox Code Playgroud)