title: ClassCastException with CoordinatorLayout in AndroidX project
body: <p>My project uses AndroidX, and has a CoordinatorLayout, AppbarLayout... I have the dependencies listed in the gradle file but the layout editor is throwing error and keeps saying classes couldn't be found. This causing a render problem but the project compiles and the app is working well.</p>
  
  <p>Gradle (app):</p>
  
  <pre><code>    dependencies {
  //...
  //...
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation 'com.google.android.material:material:1.1.0-alpha06'
      implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
      implementation 'com.google.android.material:material:1.1.0-alpha06'
      implementation 'androidx.core:core:1.2.0-alpha01'
      implementation 'androidx.media:media:1.1.0-beta01'
      implementation 'androidx.legacy:legacy-support-v4:1.0.0'
      implementation 'com.google.android.material:material:1.1.0-alpha06'
      implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0-alpha01'
      implementation group: 'androidx.coordinatorlayout', name: 'coordinatorlayout', version: '1.0.0'
  }
  </code></pre>
  
  <p>XML layout file:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:ads="http://schemas.android.com/apk/res-auto"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/rl_parent_view"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;androidx.coordinatorlayout.widget.CoordinatorLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="@color/colorBackgroundGrey"
          ads:layout_constraintEnd_toEndOf="parent"
          ads:layout_constraintStart_toStartOf="parent"
          ads:layout_constraintTop_toTopOf="parent"&gt;
  
          &lt;com.google.android.material.appbar.AppBarLayout
              android:id="@+id/appBarlayout"
              android:layout_width="match_parent"
              android:layout_height="280dp"
              android:fitsSystemWindows="true"
              android:theme="@style/ThemeOverlay.AppCompat.ActionBar"&gt;
  
              &lt;com.google.android.material.appbar.CollapsingToolbarLayout
                  android:id="@+id/collapsingToolbarLayout"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:fitsSystemWindows="true"
                  ads:contentScrim="?attr/colorPrimary"
                  ads:layout_scrollFlags="scroll|exitUntilCollapsed"&gt;
  
                  &lt;RelativeLayout
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      ads:layout_collapseMode="parallax"&gt;
  
                      &lt;com.balysv.materialripple.MaterialRippleLayout
                          android:layout_width="match_parent"
                          android:layout_height="match_parent"
                          ads:mrl_rippleAlpha="0.2"
                          ads:mrl_rippleColor="@color/colorRipple"
                          ads:mrl_rippleHover="true"
                          ads:mrl_rippleOverlay="true"&gt;
  
                          &lt;ImageView
                              android:id="@+id/imv_image"
                              android:layout_width="match_parent"
                              android:layout_height="match_parent"
                              android:contentDescription="@string/text_image_view_descrip"
                              android:scaleType="centerCrop"
                              ads:layout_collapseMode="none"
                              ads:srcCompat="@drawable/ic_launcher_foreground" /&gt;
  
                      &lt;/com.balysv.materialripple.MaterialRippleLayout&gt;
  
  
                  &lt;/RelativeLayout&gt;
  
                  &lt;androidx.appcompat.widget.Toolbar
                      android:id="@+id/toolbar"
                      android:layout_width="match_parent"
                      android:layout_height="?attr/actionBarSize"
                      android:background="@color/demo_dark_transparent"
                      ads:layout_collapseMode="pin"
                      ads:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /&gt;
  
              &lt;/com.google.android.material.appbar.CollapsingToolbarLayout&gt;
  
          &lt;/com.google.android.material.appbar.AppBarLayout&gt;
  
          &lt;androidx.cardview.widget.CardView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_margin="10dp"
              android:foreground="?android:attr/selectableItemBackground"
              ads:behavior_overlapTop="64dp"
              ads:cardCornerRadius="3dp"
              ads:cardElevation="3sp"
              ads:cardPreventCornerOverlap="false"
              ads:cardUseCompatPadding="true"
              app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"&gt;
  
  
              &lt;androidx.core.widget.NestedScrollView
                  android:id="@+id/nestedScrollView"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:clipToPadding="false"&gt;
  
                  &lt;RelativeLayout
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"&gt;
  
                      &lt;include
                          android:id="@+id/lyt_main_content"
                          layout="@layout/include_news_content"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_alignParentStart="true"
                          android:layout_alignParentTop="true"
                          android:visibility="visible" /&gt;
  
                      &lt;ViewFlipper
                          android:id="@+id/view_flipper2"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_alignParentBottom="true"
                          android:background="#F44336"&gt;
  
                      &lt;/ViewFlipper&gt;
  
                  &lt;/RelativeLayout&gt;
  
              &lt;/androidx.core.widget.NestedScrollView&gt;
  
          &lt;/androidx.cardview.widget.CardView&gt;
      &lt;/androidx.coordinatorlayout.widget.CoordinatorLayout&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  
  <p>Tried almost everything I could without success.</p>
  
  <p>EDIT:</p>
  
  <p>Java class (import):</p>
  
  <pre><code>import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.graphics.Color;
  import android.net.Uri;
  import android.os.Bundle;
  import android.os.Handler;
  import android.util.Log;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.view.ViewGroup;
  import android.view.animation.AnimationUtils;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  import android.widget.ImageView;
  import android.widget.LinearLayout;
  import android.widget.RelativeLayout;
  import android.widget.TextView;
  import android.widget.Toast;
  import android.widget.ViewFlipper;
  
  import androidx.appcompat.app.AppCompatActivity;
  import androidx.appcompat.widget.Toolbar;
  import androidx.coordinatorlayout.widget.CoordinatorLayout;
  import androidx.core.app.ActivityCompat;
  import androidx.core.app.ActivityOptionsCompat;
  import androidx.core.content.ContextCompat;
  import androidx.core.view.ViewCompat;
  import androidx.core.widget.NestedScrollView;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/PoUAW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PoUAW.png" alt="enter image description here"></a></p>