title: Kotlin-android: unresolved reference databinding
body: <p>I have following fragment class written in Java using the new databinding library</p>
  
  <pre><code>import com.example.app.databinding.FragmentDataBdinding;
  
  public class DataFragment extends Fragment {
  
      @Nullable
      private FragmentDataBinding mBinding;
  
      @Nullable
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_data, container, false);
          return mBinding.getRoot();
      }
  }
  </code></pre>
  
  <p>It compiles and runs fine.<br>
  I tried to rewrite it in Kotlin and came up with the following:</p>
  
  <pre><code>import com.example.app.databinding.FragmentDataBdinding
  
  class ProfileFragment : Fragment() {
  
      private var mBinding: FragmentDataBinding? = null
  
      override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
          mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_data, container, false)
          return mBinding!!.getRoot()
      }
  }
  </code></pre>
  
  <p>But now step <code>:app:compileDebugKotlin</code> outputs the following:</p>
  
  <blockquote>
    <p>Error:(16, 38) Unresolved reference: databinding<br>
    Error:(37, 27) Unresolved reference: FragmentDataBinding</p>
  </blockquote>
  
  <p>How can I use android-databinding library with Kotlin?</p>
  
  <p>My top-level <code>build.gradle</code>:</p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:1.3.0'
          classpath 'com.android.databinding:dataBinder:1.0-rc4'
      }
  }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  </code></pre>
  
  <p>My <code>build.gradle</code> in app dir (only relevant parts):</p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'com.android.databinding'
  apply plugin: 'kotlin-android'
  
  dependencies {
      compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  }
  
  buildscript {
      ext.kotlin_version = '0.14.451'
      repositories {
          mavenCentral()
      }
  
      dependencies {
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
          classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
      }
  }
  repositories {
      mavenCentral()
      maven {
          url 'http://oss.sonatype.org/content/repositories/snapshots'
      }
  }
  </code></pre>
  
  <p>I'm using Android Studio 1.4, Build tools version 23.0.1, Android SDK 23, SDK tools 24.4.0</p>