title: Why does Databinding is not giving proper exception?
body: <pre><code>error: package ViewModel does not exist
  public abstract void setLoginViewModel(@Nullable ViewModel.LoginViewModel LoginViewModel);
  </code></pre>
  
  <p>error no:  It is showing error in ActivityMainBinding.java 16 no. line which is "import com.jimmytrivedi.learning.mvvmloginsignupdemo.ViewModel;"</p>
  
  <p>How can I solve the above exception while working with DataBindings?</p>
  
  <p>What I tried: </p>
  
  <ul>
  <li>Invalidate cache / restart</li>
  <li>Recheck XML attributes</li>
  <li>Rename small letter package name</li>
  <li>--debug --stacktrace build with gradle</li>
  </ul>
  
  <p>Nothing is working. No other solution on google, StackOverflow and Youtube is working.</p>
  
  <pre><code>package com.jimmytrivedi.learning.mvvmloginsignupdemo.ViewModel;
  </code></pre>
  
  <p><strong>MainActivity</strong>:</p>
  
  <pre><code>import android.os.Bundle;
  import android.text.TextUtils;
  
  import androidx.annotation.Nullable;
  import androidx.appcompat.app.AppCompatActivity;
  import androidx.databinding.DataBindingUtil;
  import androidx.lifecycle.Observer;
  import androidx.lifecycle.ViewModelProviders;
  
  import com.jimmytrivedi.learning.mvvmloginsignupdemo.Model.LoginUser;
  import com.jimmytrivedi.learning.mvvmloginsignupdemo.R;
  import com.jimmytrivedi.learning.mvvmloginsignupdemo.ViewModel.LoginViewModel;
  import com.jimmytrivedi.learning.mvvmloginsignupdemo.databinding.ActivityMainBinding;
  
  
  import java.util.Objects;
  
  public class MainActivity extends AppCompatActivity implements Observer&lt;LoginUser&gt; {
  
      private LoginViewModel loginViewModel;
      private ActivityMainBinding binding;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          loginViewModel = ViewModelProviders.of(MainActivity.this).get(LoginViewModel.class);
  
          // Inflate view and obtain an instance of the binding class.
          binding = DataBindingUtil.setContentView(MainActivity.this, R.layout.activity_main);
  
          // Specify the current activity as the lifecycle owner.
          binding.setLifecycleOwner(this);
          binding.setLoginViewModel(loginViewModel);
          loginViewModel.getUser().observe(MainActivity.this, this);
  
      }
  
      @Override
      public void onChanged(@Nullable LoginUser loginUser) {
          if (TextUtils.isEmpty(Objects.requireNonNull(loginUser).getEmail())) {
              binding.emailId.setError("Email Id can't be blank");
              binding.emailId.requestFocus();
          } else if (!loginUser.isEmailValid()) {
              binding.emailId.setError("Please enter valid Email Id");
              binding.emailId.requestFocus();
          } else if (TextUtils.isEmpty(Objects.requireNonNull(loginUser).getPassword())) {
              binding.password.setError("Password can't be blank");
              binding.password.requestFocus();
          } else if (!loginUser.isPasswordLengthGreaterThan5()) {
              binding.password.setError("Password length must be at least 8 digit");
              binding.password.requestFocus();
          } else {
              binding.fetchEmailId.setText(loginUser.getEmail());
              binding.fetchPassword.setText(loginUser.getPassword());
          }
      }
  }
  </code></pre>
  
  <p><strong>activity_main.xml</strong></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"
      xmlns:tools="http://schemas.android.com/tools"&gt;
  
      &lt;data&gt;
          &lt;variable
              name="LoginViewModel"
              type="com.jimmytrivedi.learning.mvvmloginsignupdemo.ViewModel.LoginViewModel" /&gt;
      &lt;/data&gt;
  
  
      &lt;androidx.core.widget.NestedScrollView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:isScrollContainer="true"&gt;
  
          &lt;androidx.constraintlayout.widget.ConstraintLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              tools:context=".View.MainActivity"&gt;
  
              &lt;TextView
                  android:id="@+id/heading"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginStart="8dp"
                  android:layout_marginTop="16dp"
                  android:layout_marginEnd="8dp"
                  android:lineSpacingExtra="8sp"
                  android:text="Login Example Using MVVM, DataBinding with LiveData"
                  android:textAlignment="center"
                  android:textSize="18sp"
                  android:textStyle="bold"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toTopOf="parent" /&gt;
  
              &lt;EditText
                  android:id="@+id/email_id"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginStart="32dp"
                  android:layout_marginTop="32dp"
                  android:layout_marginEnd="32dp"
                  android:ems="10"
                  android:hint="E-Mail Address"
                  android:inputType="textEmailAddress"
                  android:text="@={LoginViewModel.email}"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/heading" /&gt;
  
              &lt;EditText
                  android:id="@+id/password"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginStart="32dp"
                  android:layout_marginTop="16dp"
                  android:layout_marginEnd="32dp"
                  android:ems="10"
                  android:hint="Password"
                  android:inputType="textPassword"
                  android:text="@={LoginViewModel.password}"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/email_id" /&gt;
  
              &lt;Button
                  android:id="@+id/login"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginStart="32dp"
                  android:layout_marginTop="32dp"
                  android:layout_marginEnd="32dp"
                  android:onClick="@{(v) -&gt; LoginViewModel.onClick(v)}"
                  android:text="Click to Login"
                  android:textSize="18sp"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/password" /&gt;
  
              &lt;TextView
                  android:id="@+id/result"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginStart="8dp"
                  android:layout_marginTop="60dp"
                  android:layout_marginEnd="8dp"
                  android:gravity="center"
                  android:text="See the Results Below From LiveDataBinding"
                  android:textColor="@android:color/background_dark"
                  android:textSize="16sp"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/login" /&gt;
  
              &lt;TextView
                  android:id="@+id/fetch_email_id"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginStart="8dp"
                  android:layout_marginTop="8dp"
                  android:layout_marginEnd="8dp"
                  android:text="---"
                  android:textColor="@android:color/holo_blue_light"
                  android:textSize="20sp"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/result" /&gt;
  
              &lt;TextView
                  android:id="@+id/fetch_password"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginStart="8dp"
                  android:layout_marginTop="8dp"
                  android:layout_marginEnd="8dp"
                  android:layout_marginBottom="32dp"
                  android:text="---"
                  android:textColor="@android:color/holo_blue_light"
                  android:textSize="20sp"
                  app:layout_constraintBottom_toBottomOf="parent"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/fetch_email_id" /&gt;
  
          &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
      &lt;/androidx.core.widget.NestedScrollView&gt;
  
  &lt;/layout&gt;
  </code></pre>
  
  <p>LoginViewModel:</p>
  
  <pre><code>    package com.jimmytrivedi.learning.mvvmloginsignupdemo.ViewModel;
  
      import android.view.View;
  
      import androidx.lifecycle.MutableLiveData;
      import androidx.lifecycle.ViewModel;
  
      import com.jimmytrivedi.learning.mvvmloginsignupdemo.Model.LoginUser;
  
      public class LoginViewModel extends ViewModel {
  
          public MutableLiveData&lt;String&gt; email = new MutableLiveData&lt;&gt;();
          public MutableLiveData&lt;String&gt; password = new MutableLiveData&lt;&gt;();
          private MutableLiveData&lt;LoginUser&gt; userMutableLiveData;
  
          public MutableLiveData&lt;LoginUser&gt; getUser() {
              if (userMutableLiveData == null) {
                  userMutableLiveData = new MutableLiveData&lt;&gt;();
              }
              return userMutableLiveData;
          }
  
           public void onClick(View view) {
              LoginUser loginUser = new LoginUser(email.getValue(), password.getValue());
              userMutableLiveData.setValue(loginUser);
          }
      }
  </code></pre>
  
  <p>NOTE:</p>
  
  <p>I'll change package name to small letter like this  viewmodel, it'll give error to ActivityMainImpl which is not generated by me</p>