1

I created a new project on Android Studio 3.2.1 and enabled data binding, but I'm getting an error that it could not find the DataBindingComponent class.

I am not able to build from command line using./gradlew assembleDebug

symbol: class DataBindingComponent location: class ActivityMainBinding /home/project/newGradle/app/build/generated/source/dataBinding/baseClasses/debug/com/demo/gradledemo/databinding/ActivityMainBinding.java:38: error: cannot find symbol @Nullable ViewGroup root, boolean attachToRoot, @Nullable DataBindingComponent component) {

symbol: class DataBindingComponent location: class ActivityMainBinding /home/project/newGradle/app/build/generated/source/dataBinding/baseClasses/debug/com/demo/gradledemo/databinding/ActivityMainBinding.java:49: error: cannot find symbol @Nullable DataBindingComponent component) {

android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.demo.gradledemo"
    minSdkVersion 19
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner   
"android.support.test.runner.AndroidJUnitRunner"

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
    }

    debug{
        debuggable true
    }
}

dataBinding {
    enabled = true
}

} 
Chetan Chaudhari
  • 323
  • 5
  • 15
  • Some time it does not work then clean the project, If wont work then add data in you xml and implement like this-> – Shiv Kumar Jan 10 '19 at 07:37
  • check this answer : https://stackoverflow.com/questions/50594507/cannot-find-symbol-databindingcomponent-on-android-studio-3-2-canary-16-kotlin-p/52497120#52497120 – B.mansouri Jan 10 '19 at 08:11
  • I am not able to build from command line using. /gradlew assembleDebug – Chetan Chaudhari Jan 10 '19 at 10:04

0 Answers0