title: Unresolved reference: databinding when importing databinding to MainActivity
body: <p>When I try to import databinding to MainActivity, I get an "Unresolved reference: databinding" error.</p>
  
  <p>MainActivity file:</p>
  
  <pre><code>package &lt;package-name&gt;
  
  import &lt;package-name&gt;.databinding.FragmentLoginBinding
  
  class LoginFragment : Fragment() {
  
      override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
                                savedInstanceState: Bundle?): View? {
          val binding = DataBindingUtil.inflate&lt;FragmentLoginBinding&gt;(inflater,
              R.layout.fragment_login,container,false)
  
          binding.register_btn.setOnClickListener { view : View -&gt;
              view.findNavController().navigate(R.id.action_loginFragment_to_welcomeFragment)
          }
  
          binding.login_btn.setOnClickListener { view : View -&gt;
              view.findNavController().navigate(R.id.action_loginFragment_to_welcomeFragment)
          }
  
          return binding.root
      }
  }
  </code></pre>
  
  <p>where package-name is my package name. The package name is recognized, only databinding is not, so it shows in red.</p>
  
  <p>I guess because of that, FragmentLoginBinding in </p>
  
  <pre><code>val binding = DataBindingUtil.inflate&lt;FragmentLoginBinding&gt;(inflater,
              R.layout.fragment_login,container,false)
  </code></pre>
  
  <p>is not recognized too.</p>
  
  <p>Project build.gradle file:</p>
  
  <pre><code>buildscript {
      ext{
          kotlin_version = '1.3.61'
          gradle_version = '3.6.0'
          data_binding_compiler_version = gradle_version
      }
      dependencies {
          classpath "com.android.tools.build:gradle:$gradle_version"
      }
  }
  </code></pre>
  
  <p>App build.gradle file:</p>
  
  <pre><code>apply plugin: 'kotlin-kapt'
  
  android {
      dataBinding {
          enabled = true
      }
  }
  
  dependencies {
      kapt "androidx.databinding:databinding-compiler:$data_binding_compiler_version"
  }
  </code></pre>
  
  <p>I already tried to follow this codelab <a href="https://codelabs.developers.google.com/codelabs/kotlin-android-training-add-navigation/#0" rel="nofollow noreferrer">https://codelabs.developers.google.com/codelabs/kotlin-android-training-add-navigation/#0</a> and also search for solutions, but wasn't able to fix it.</p>
  
  <p>Anyone can help, please?</p>
  
  <p>Thanks in advance.</p>