August 2018
Beginner
178 pages
4h 56m
English
In your Gradle project, you have the build.gradle file located somewhere in the root of your project. Make sure that you have this buildScript section in that file.
buildscript { ext.kotlin_version = '1.2.40' repositories { mavenCentral() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" }}
This tells Gradle to use a Kotlin plugin and adds Maven central to the list of repositories. With the plugin added, we still need the Kotlin standard library to be able to compile a Kotlin source code. If you have multiple Gradle modules, make sure that the module's build.gradle file in which you plan to use Kotlin has the following:
apply plugin: "kotlin"repositories { mavenCentral()}dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" ...Read now
Unlock full access