0

Build fails with error "cannot find symbol DataBindingComponent" in all generated binding classes.If I remove the room compiler dependency from my module gradle, then it unable to find room db at run time saying "Db_Impl does not exist".

def room_version = "1.1.1"
implementation "android.arch.persistence.room:runtime:$room_version"
//kapt "android.arch.persistence.room:compiler:$room_version"
//kapt 'com.android.databinding:compiler:3.2.1'  
andronil
  • 1
  • 1

3 Answers3

1

dependencies { def room_version = "2.1.0-alpha06"

implementation "androidx.room:room-runtime:1.1.1"
annotationProcessor "androidx.room:room-compiler:1.1.1" // For Kotlin use kapt instead of annotationProcessor

// optional - Kotlin Extensions and Coroutines support for Room
implementation "androidx.room:room-ktx:1.1.1"

// optional - RxJava support for Room
implementation "androidx.room:room-rxjava2:1.1.1"

// optional - Guava support for Room, including Optional and ListenableFuture
implementation "androidx.room:room-guava:1.1.1"

// Test helpers
testImplementation "androidx.room:room-testing:1.1.1"

}

0

Try this.. add this dependency into app level gradle file.

    implementation "android.arch.persistence.room:runtime:1.1.1"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"

more information refer this link https://www.simplifiedcoding.net/android-room-database-example/

0

You are missing kotlin's annotation processor plugin. Add this to the top of your app level gradle file

apply plugin: 'kotlin-kapt'

and uncomment the data binding dependency. Sync after this.

rohiththammaiah
  • 153
  • 1
  • 5