title: WrongViewCast error: Unexpected implicit cast to TabLayout: layout tag was Linear Layout
body: <p>I am trying to copy a previously worked version of a tab layout, however since the library dependencies changed, I get unexpected errors. In my xml, I have:</p>
  
  <pre><code>&lt;com.google.android.material.tabs.TabLayout
          android:id="@id/tabLayout"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintEnd_toStartOf="@id/nextButton"
          android:layout_marginEnd="15dp"
          android:layout_marginStart="20dp"
          android:layout_marginBottom="30dp"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"&gt;
  
          &lt;com.google.android.material.tabs.TabItem
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="1st" /&gt;
  
          &lt;com.google.android.material.tabs.TabItem
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="2nd" /&gt;
  
          &lt;com.google.android.material.tabs.TabItem
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="3rd" /&gt;
      &lt;/com.google.android.material.tabs.TabLayout&gt;
  </code></pre>
  
  <p>and this is inside a constraint layout. When I try to find this view by id: </p>
  
  <pre><code>TabLayout tabLayout = findViewById(R.id.tabLayout);
  </code></pre>
  
  <p>I get the error of WrongViewCast. <code>import com.google.android.material.tabs.TabLayout;</code> I import the correct library. What is the correct way of calling findViewById in TabLayout context?</p>