Run single kotlin class with main function in android studio

后端 未结 15 762
后悔当初
后悔当初 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:15

    1. Create default project with gradle

      gradle init -> kotlin-application

    2. Import project into Android Studio
    3. Create new 'run configuration' with 'Application' template and set 'app.AppKt' as a 'Main class' (see build.gradel->mainClassName).

    4. Run!

提交回复
热议问题