title: Android databinding cannot find the setter for attribute
body: <p>I'm trying to use android databinding library with Kotlin and want provide custom attribute for <code>RecyclerView</code>. For this I've created a file with this code:</p>
  
  <pre><code>@BindingAdapter("config")
  fun configRecyclerView(recyclerView: RecyclerView, config: RecyclerViewConfig) {
      config.apply(recyclerView)
  }
  </code></pre>
  
  <p>Where <code>RecyclerViewConfig</code> is:</p>
  
  <pre><code>class RecyclerViewConfig private constructor(
      val adapter: RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt;,
      val layoutManager: RecyclerView.LayoutManager,
      val isNestedScrollingEnabled: Boolean,
      val hasFixedSize: Boolean
  ) {
  
      fun apply(recyclerView: RecyclerView) {
          recyclerView.layoutManager = layoutManager
          recyclerView.isNestedScrollingEnabled = isNestedScrollingEnabled
          recyclerView.setHasFixedSize(hasFixedSize)
          recyclerView.adapter = adapter
      }
  
      class Builder {
  
          private lateinit var adapter: RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt;
          private lateinit var layoutManager: RecyclerView.LayoutManager
          private var isNestedScrollingEnabled = true
          private var hasFixedSize = true
  
          fun adapter(adapter: RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt;): Builder {
              this.adapter = adapter
              return this
          }
  
          fun layoutManager(layoutManager: RecyclerView.LayoutManager): Builder {
              this.layoutManager = layoutManager
              return this
          }
  
          fun nestedScrollingEnabled(isNestedScrollingEnabled: Boolean): Builder {
              this.isNestedScrollingEnabled = isNestedScrollingEnabled
              return this
          }
  
          fun hasFixedSize(hasFixedSize: Boolean): Builder {
              this.hasFixedSize = hasFixedSize
              return this
          }
  
          fun build() = RecyclerViewConfig(adapter, layoutManager, isNestedScrollingEnabled, hasFixedSize)
      }
  
  }
  </code></pre>
  
  <p>Also I have my own<code>ViewModel</code> with <code>RecyclerViewConfig</code> inside:</p>
  
  <pre><code>class AdvertPageViewModel(val context: Context) : RecyclerViewModel {
  
      private val adapter: RealtyAdvertAdapter
      private val listener: OnPageContentsClickListener
      private val config: RecyclerViewConfig
  
      init {
          listener = createListener()
          config = createConfig()
          adapter = RealtyAdvertAdapter(createAdvert().toPageItems(), listener)
      }
  
      override fun getConfig() = config
  
      private fun createConfig() =
              RecyclerViewConfig.Builder()
                      .adapter(adapter)
                      .layoutManager(LinearLayoutManager(context))
                      .build()
  
  
      private fun createListener() = object: OnPageContentsClickListener {
  
          override fun onCallButtonClick(phone: String) {
              Log.i(TAG, "onCallButtonClick")
          }
  
          override fun onWriteButtonClick(phone: String) {
              Log.i(TAG, "onWriteButtonClick")
          }
  
      }
  }
  </code></pre>
  
  <p>I create it like this:</p>
  
  <pre><code>override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
      super.onViewCreated(view, savedInstanceState)
      viewModel = AdvertPageViewModel(context)
      if (view != null) {
          val binding = FragmentAdvertPageBinding.bind(view)
          binding.viewModel = viewModel
      }
  }
  </code></pre>
  
  <p>And there's layout for Fragment:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  
      &lt;data&gt;
          &lt;variable
              name="viewModel"
        type="ru.am.realty.ui.fragments.advertpage.AdvertPageViewModel"/&gt;
      &lt;/data&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"&gt;
  
          &lt;android.support.v7.widget.RecyclerView
              android:id="@+id/rv_content"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              app:config="@{viewModel.getConfig()}"/&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p>The problem is that when I try to build application, there's an error occured:</p>
  
  <pre><code>Error:(20, 27) Cannot find the setter for attribute 'app:config' with 
  parameter type ru.am.realty.ui.base.viewmodel.RecyclerViewConfig on 
  android.support.v7.widget.RecyclerView. 
  </code></pre>
  
  <p>So, I was looking for any solutions, but without success. And I have no idea, what's wrong with my code</p>
  
  <p>UPDATE: there's gradle file</p>
  
  <pre><code>apply plugin: 'com.android.library'
  apply plugin: 'kotlin-android'
  apply plugin: 'kotlin-android-extensions'
  apply plugin: 'kotlin-kapt'
  
  android {
      compileSdkVersion 26
      defaultConfig {
          minSdkVersion 17
          targetSdkVersion 26
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          debug {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  
      dataBinding {
          enabled = true
      }
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
      implementation 'com.android.support:appcompat-v7:26.1.0'
      implementation 'com.android.support:recyclerview-v7:26.1.0'
  
      // Rx
      implementation 'io.reactivex.rxjava2:rxkotlin:2.2.0'
      implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
  
      //di
      implementation 'com.google.dagger:dagger:2.15'
      kapt 'com.google.dagger:dagger-compiler:2.15'
  
      kapt 'com.android.databinding:compiler:3.0.1'
  
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.1'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
  }
  </code></pre>