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

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.

主站蜘蛛池模板: 杨浦区| 金沙县| 东辽县| 商水县| 平遥县| 定结县| 筠连县| 宜阳县| 鸡西市| 平罗县| 沂源县| 台东县| 吉安县| 涪陵区| 资讯 | 建昌县| 延长县| 高平市| 株洲县| 乐都县| 沁水县| 平山县| 桐柏县| 独山县| 教育| 平泉县| 宝清县| 青州市| 天门市| 伊宁市| 台南市| 太白县| 丘北县| 马龙县| 贵州省| 上林县| 松阳县| 泽州县| 兴业县| 庄河市| 砚山县|