...
You need Android Studio 3.3.x, or later. You may either start with a new project or an existing project.
...
Start with an
...
Existing Project
Goto Tools|Kotlin|Configure Kotin in Project.
- You will present with a dialog with two options. Choose "Android with Gradle":
- Choose the "app" to enable Kotlin integration (choose the latest version corresponding to the plugin on your IDE):
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
apply plugin: 'com.android.application' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android' // omitted... dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } |
Start with a New Project
- Start with the new project wizard on Android studio.
- Choose "Kotlin" language:
...