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

  • Kotlin Blueprints
  • Ashish Belagali Hardik Trivedi Akshay Chordiya
  • 199字
  • 2021-07-02 21:50:21

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.

主站蜘蛛池模板: 黄浦区| 琼海市| 彩票| 资兴市| 休宁县| 新民市| 平凉市| 准格尔旗| 天门市| 岳阳县| 杭锦旗| 云安县| 平乡县| 蓬溪县| 平潭县| 宾川县| 鸡泽县| 荆州市| 盐池县| 五寨县| 济源市| 莱芜市| 沁阳市| 巴楚县| 迁安市| 泗洪县| 宜兴市| 富阳市| 米泉市| 安新县| 江川县| 潞西市| 黄梅县| 东海县| 昌黎县| 蒲江县| 垣曲县| 台东县| 盐亭县| 盐山县| 都安|