androidandroid-studioandroid-studio-3.1

Android Studio fails to generate databinding after 3.1.0 update


This morning I made an update to android studio from 3.0.1 to 3.1.0. After updating the gradle to latest version I still get build error regarding data binding.

My gradle-wrapper.properties:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

All my errors are like the one below:

/Users/mp/Documents/GitHub/projectx/app/build/generated/source/dataBinding/baseClasses/Staging/debug/me/projectx/asdasd/databinding/GridItemActivityTypeBinding.java:57: error: cannot find symbol
      @Nullable DataBindingComponent component) {
                ^
  symbol:   class DataBindingComponent
  location: class GridItemActivityTypeBinding

Does anyone have any idea why would my data binding not generate after the android studio 3.1 update? Thanks in advance

Edit 1: Forgot to say, I tried clean/rebuild/invalidate cache & restart/deleted build folder.


Solution

  • Ok, so those who are wondering how I fixed this. The solution is quite simple but probably you won't like it.

    I had to move all my classes that were used in data binding in the project root package and after it started to work again.