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

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.

主站蜘蛛池模板: 永吉县| 日土县| 兰考县| 水富县| 江华| 瓦房店市| 辽宁省| 综艺| 手机| 丽江市| 台前县| 凌海市| 平泉县| 疏勒县| 荔浦县| 乌拉特中旗| 白玉县| 顺昌县| 临江市| 渝北区| 鹤岗市| 略阳县| 遂昌县| 清新县| 天镇县| 双流县| 泰州市| 镇康县| 独山县| 霍州市| 彩票| 桦甸市| 泰和县| 华蓥市| 屏东市| 吕梁市| 喀什市| 环江| 长治市| 霍林郭勒市| 耒阳市|