In Android studio 3.6, after creating new project, I am not able to created binding generated class for multiple folders.
I have multiple layout folders:
res/layout
res/layouts/dashboard
res/layouts/notifications
I am able to created binding class for
res/layout
but its not working for other layout folders.
App gradle file:
dataBinding{
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java']
res.srcDirs =
[
'src/main/res/layouts/notification',
'src/main/res/layout/dashboard',
'src/main/res/layouts',
'src/main/res/layout',
'src/main/res'
]
assets.srcDirs = ['src/main/assets', 'src/main/assets/']
}
}
Resource folder structure:
I have attached sample project which I have created in android studio 3.6. Source code link
It's a bug in android studio, It has been fixed in android studio 4.0 beta and 4.1 canary. And google will release hotfix for 3.6 to fix it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With