title: Data binding "error: cannot find symbol class Models"
body: <p>First, I need to acknowledge the clearly very similar <strong>but not duplicate</strong> issue <a href="https://stackoverflow.com/questions/35126670/android-data-binding-error-cannot-find-symbol-class/35126876">here</a>. None of the proposed solutions in that thread work.</p>
  
  <p>My application file structure is as follows:</p>
  
  <pre><code>app
    java
      [mydomain].[myapplication]
        Models
          DataModel.java
        MainActivity.java
    res
      layout
        activity_main.xml
        content_main.xml
        my_inner_layout.xml
  </code></pre>
  
  <p>My app <code>build.gradle</code> contains</p>
  
  <pre><code>dataBinding {
      enabled = true
  }
  </code></pre>
  
  <p>In <code>MainActivity.java</code> I have</p>
  
  <pre><code>import [mydomain].[myapplication].Models.DataModel;
  
  public class MainActivity extends AppCompatActivity
          implements NavigationView.OnNavigationItemsSelectedListener {
  
      DataModel dataModel;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          ... &lt;other layout creation template code&gt; ...
  
          ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
          dataModel = new DataModel();
          binding.setValues(dataModel);
      }
  
      &lt;navigation and auto-generated methods&gt;
  }
  </code></pre>
  
  <p>My <code>my_inner_layout.xml</code> contains</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;data&gt;
          &lt;variable
              name="values"
              type="[mydomain].[myapplication].Models.DataModel" /&gt;
      &lt;/data&gt;
      &lt;android.support.constraint.ConstraintLayout
          xmlns:app="http://schemas.android.com/apk/res-auto"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:visibility="visible"
          &gt;
  
          &lt;TextView
              android:id="@+id/intro_text"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="20dp"
              android:text="@{values.valueOne}"/&gt;
  
          &lt;TextView
              android:id="@+id/buying_recommendation"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@id/intro_text"
              app:layout_constraintTop_toBottomOf="@id/intro_text"
              android:text="@{values.valueTwo}"/&gt;
      &lt;/android.support.constraint.ConstraintLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p>I am passing <code>bind:values="@{values}"</code> through from activity_main to its <code>include</code>d app_bar_main to its content_main to its my_inner_layout with that same <code>&lt;data&gt;</code> value in each. Android Studio is telling me "namespace 'bind' is not bound".</p>
  
  <p>If I try to run this, I get "Compilation failed; see the compiler error output for details." Looking in the build output, I see:</p>
  
  <p><img src="https://i.stack.imgur.com/APs0P.png" alt="Java compiler errors when building"></p>
  
  <p>In text, the errors are variously <code>error: cannot find symbol class Models</code> and <code>error: package Models does not exist</code></p>
  
  <p>If I move DataModel.java out of the Models package and directly in to [mydomain].[myapplication], then I get a different result. It <em>does</em> build and run in the emulator, but with much of the layout information failing to appear. No hamburger menu in the top left, no title text in the header, and no settings button in the top right values previously automatically included by the autogenerated code in Android Studio. I am unable to set the title in code using setTitle, either.</p>
  
  <p>Swiping from the left <em>does</em> bring in the navigation drawer however.</p>
  
  <p>I have tried invalidating caches and restarting, cleaning, rebuilding both with the model file in Models and separately.</p>
  
  <p>What I want, chiefly, is to be able to use the project structure I want. To put my models classes in a models sub-package. Once that is complete, I want to make sure the full layout information comes through, including the hamburger menu icon, settings icon, and title. How can I achieve this?</p>