Run single kotlin class with main function in android studio

后端 未结 15 760
后悔当初
后悔当初 2020-12-13 13:04

I am trying to get familiar with Kotlin to use in my android apps. So first I want to try out some simple kotlin examples, just to get familiar with syntax of kotlin.

<
15条回答
  •  [愿得一人]
    2020-12-13 13:14

    In my case I add these:

    1. Add this apply plugin: 'kotlin-android'

    2. And also

    dependencies {
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:$your-version' 
    }
    

    This fixes the problem.

提交回复
热议问题