Adding dependencies

To run tests, we must satisfy some dependencies. We will update our application configuration by extending build.gradle to support testing and to provide the classes we need. Open build.gradle and extend it as follows:

 apply plugin: "com.android.application" apply plugin: "kotlin-android" apply plugin: "kotlin-android-extensions" repositories { maven { url "https://maven.google.com" } } android { ... sourceSets { main.java.srcDirs += [ 'src/main/kotlin', 'src/common/kotlin', 'src/debug/kotlin', 'src/release/kotlin', 'src/staging/kotlin', 'src/preproduction/kotlin', 'src/debug/java', 'src/release/java', 'src/staging/java', 'src/preproduction/java', 'src/testDebug/java', 'src/testDebug/kotlin', 'src/androidTestDebug/java', ...

Get Mastering Android Development with Kotlin now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.