title: Type mismatch: inferred type is but was expected
body: <p>I'm new to Kotlin and here is my problem:</p>
  
  <p>I use dataBinding in my app and When I want to set my variable from layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;layout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  &lt;data&gt;
      &lt;import type="android.view.View"/&gt;
      &lt;variable
              name="noteViewModel"
              type="moeindeveloper.kotlinroomaac.ViewModel.NoteViewModel" /&gt;
  &lt;/data&gt;
  
  &lt;android.support.constraint.ConstraintLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          tools:context=".View.MainActivity"&gt;
      &lt;ProgressBar
              android:id="@+id/loading"
              android:layout_width="48dp"
              android:layout_height="48dp"
              android:indeterminate="true"
              android:visibility="@{noteViewModel.isLoading.get() ? View.VISIBLE : View.GONE}"
              app:layout_constraintBottom_toTopOf="parent"
              app:layout_constraintEnd_toEndOf="@id/repository_rv"
              app:layout_constraintVertical_bias="0.0"
              app:layout_constraintHorizontal_bias="0.5"
              app:layout_constraintStart_toStartOf="@id/repository_rv"
              app:layout_constraintTop_toTopOf="@id/repository_rv" /&gt;
  
      &lt;android.support.v7.widget.RecyclerView
              android:id="@+id/repository_rv"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:indeterminate="true"
              android:visibility="@{noteViewModel.isLoading.get() ? View.GONE : View.VISIBLE}"
              app:layout_constraintBottom_toTopOf="parent"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toTopOf="parent"
              tools:listitem="@layout/row_item" /&gt;
      &lt;android.support.design.widget.FloatingActionButton
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/addButton"
              android:src="@drawable/ic_add"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toTopOf="parent"
              app:layout_constraintVertical_bias="0.98"/&gt;
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>My main activity:</p>
  
  <pre><code>@Inject lateinit var viewModelFactory: ViewModelProvider.Factory
  </code></pre>
  
  <p>on create:</p>
  
  <pre><code>val viewModel:NoteViewModel = ViewModelProviders.of(this,viewModelFactory)
          .get(NoteViewModel::class.java)
  
      binding.noteViewModel = viewModel
      binding.executePendingBindings()
  </code></pre>
  
  <p>so up to this point, my code is correct but, when I hit run,
  I face these errors:</p>
  
  <pre><code>Cannot access class 'ViewModel.NoteViewModel'. Check your module classpath for missing or conflicting dependencies
  
  Type mismatch: inferred type is moeindeveloper.kotlinroomaac.ViewModel.NoteViewModel but ViewModel.NoteViewModel? was expected
  </code></pre>
  
  <p>I use android studio 3.2.1
  kotlin version: 1.2.71</p>
  
  <p>any thoughts on this?</p>