Cannot find symbol DataBindingComponent on Android Studio 3.2 Canary 16 Kotlin project

With the following setup

Android Studio 3.2.1 Build #AI-181.5540.7.32.5056338, built on October 8, 2018 JRE: 1.8.0_152-release-1136-b06 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.13.3

And DataBinding simply enable by having this in my app build.gradle

apply plugin: 'kotlin-kapt'

and then

    dataBinding {
        enabled = true
    }

and also this in my gradle.wrapper properties

android.databinding.enableV2=true

I had the same errors:

could not find the DataBindingComponent class.

I had more than 100 of them. It turned out that those errors were not important and that the true underlying error was not showed by the IDE. Therefore, I increased the number of errors that the Kotlin compiler can display by adding this in build.gradle:

dataBinding {
    enabled = true
}
kapt {
        javacOptions {
            // Increase the max count of errors from annotation processors.
            // Default is 100.
            option("-Xmaxerrs", 500)
        }
    }

An suddenly, right below all those fake errrors, I saw the real one caused by a failed merge conflict resolution


Databinding libraries are being refactored as a part of androidx refactoring.

I found the databinding annotation processor dependency link from google's maven repository here.

I've constructed the actual gradle dependency from there.

kapt "androidx.databinding:databinding-compiler:3.2.0-alpha16"

Update As of Android studio 3.2.0-beta01, databinding no longer needs its annotation processor dependency to be declared in the gradle file, since databinding is capable of resolving its dependency.


Just delete the compiler dependency (kapt "com.android.databinding:compiler:$gradleVersion), that worked for me. Apparently, it is provided with binding plugin from 3.2.0.