'Unresolved reference' errors for android library module referenced in app module
Found the problem, my android library module was missing the kotlin configuration:
apply plugin: 'kotlin-android'
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlinVersion:<version>"
}
Although I used kotlin .kt files in it, it could build without and also
Tools -> Kotlin -> 'Configure Kotlin in projects'
had told me 'All modules with Kotlin files are configured'
Your module's build.gradle
file should have:
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
dependencies {
...
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
...
}
In my case It was apply plugin: 'kotlin-android'
,
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
and also added it on build.gradle
androidExtensions {
experimental = true
}