官术网_书友最值得收藏!

Setting up the Kotlin plugin for Android Studio

In order to ensure that Android Studio supports Kotlin, the first thing to do is to install the Kotlin plugin for Android Studio by clicking on Android Studio | Preferences | Plugins | Browse Repository |, type Kotlin in the search box, and install:

Android Studio will ask for a restart. Please follow the steps. The next step will be adding Kotlin classpath to the project level build.gradle file:

Once the classpath is added we will add Gradle project dependency into the app level build.gradle and apply the Kotlin plugin:

Now, add the Kotlin (the following screenshot also shows Anko, you can skip this for now) dependencies in the app level build.gradle file:

We are using Kotlin version 1.1.4. Sync your Gradle project and setup is complete!

Here are some tips that will save you time during set up. Always follow official tutorials. Check if your studio has the proper version. In the plugin, setup steps make a note of enabling plugin support by writing the apply plugin: kotlin-android in the build.gradle file. And make sure you restart the studio once all installation is complete.

主站蜘蛛池模板: 迁安市| 密云县| 铜鼓县| 海南省| 科技| 卓尼县| 万宁市| 黄龙县| 宜宾县| 竹北市| 克什克腾旗| 沁水县| 淮南市| 宣城市| 鲜城| 和顺县| 玛曲县| 儋州市| 沙洋县| 郑州市| 温州市| 青冈县| 育儿| 巴中市| 西峡县| 苏州市| 称多县| 罗田县| 乐都县| 中卫市| 罗山县| 类乌齐县| 新乡县| 紫云| 开江县| 肇源县| 南充市| 南宫市| 安溪县| 鹤山市| 子长县|