title: How to address "Cannot access class" error when binding to a class in a subpackage?
body: <p>Starting with Android 3.2.1, binding to classes defined in sub-packages (e.g. <code>Sub.Thing</code> in <code>com.example</code>) results in an error:</p>
  
  <blockquote>
    <p>Cannot access class 'Sub.Thing'. Check your module classpath for missing or conflicting dependencies</p>
  </blockquote>
  
  <p>What's the cause of this errror? How can it be fixed?</p>
  
  <h1>Sample Code:</h1>
  
  <p>activity_main.xml:</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"
          tools:context=".MainActivity"
      &gt;
  
      &lt;data&gt;
          &lt;import type="com.example.Sub.Thing"/&gt;
          &lt;variable name="data" type="Thing"/&gt;
      &lt;/data&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"&gt;
  
          &lt;TextView
                  android:id="@+id/name"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="@dimen/activity_vertical_margin"
                  android:layout_marginStart="@dimen/activity_horizontal_margin"
                  android:layout_marginEnd="@dimen/activity_horizontal_margin"
                  android:text="@{data.name}"/&gt;
  
          &lt;TextView
                  android:id="@+id/value"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="@dimen/activity_vertical_margin"
                  android:layout_marginStart="@dimen/activity_horizontal_margin"
                  android:layout_marginEnd="@dimen/activity_horizontal_margin"
                  android:text="@{data.value}"/&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p>Thing.kt:</p>
  
  <pre><code>package com.example.Sub
  
  data class Thing(
      var name:String,
      var value:String
  )
  </code></pre>
  
  <p>MainActivity.kt:</p>
  
  <pre><code>package com.example
  
  import android.databinding.DataBindingUtil
  import android.os.Bundle
  import android.support.v7.app.AppCompatActivity
  import com.example.Sub.Thing
  import com.example.databinding.ActivityMainBinding
  
  class MainActivity : AppCompatActivity() {
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          //setContentView(R.layout.activity_main)
  
          val activityMain:ActivityMainBinding = DataBindingUtil.setContentView(this, R.layout.activity_main)
          activityMain.data = Thing("bam", "bug-AWWK!")
      }
  }
  </code></pre>