using Kotlin 1.20.20 (not that it matters, older versions behaves the same)
When layout is in separate library module Android Studio has no problem finding and refer
I solved my issue with copy both androidExtension and buildscript from project build.gradle to module that uses the library.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath "com.android.tools.build:gradle:$gradle_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
androidExtensions {
experimental = true
}
Note: I use the following version of kotlin and gradle:
buildscript {
ext.kotlin_version = '1.3.0'
ext.gradle_version = '3.0.1'