title: The following classes could not be instantiated android.support.design.widget.CoordinatorLayout
body: <p>I am using Coordinator Layout inside the Drawer Layout. I want to show a auto hide toolbar and use movie poster in it, which will collapse when movie details are scrolled. My app also uses a drawer layout. Here is my Layout XML <code>activity_coordinator_layout</code></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/parent_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@color/white"
          android:orientation="vertical"
          tools:context="com.inov8.falconpayconsumer.activities.MovieInfo"&gt;
  
          &lt;RelativeLayout
              android:id="@+id/headerLayout"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:background="@color/red"&gt;
  
              &lt;include
                  android:id="@+id/header_layout2"
                  layout="@layout/header" /&gt;
          &lt;/RelativeLayout&gt;
  
          &lt;include
              android:id="@+id/sub_header"
              layout="@layout/subheader"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@id/headerLayout"
              android:visibility="visible" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fitsSystemWindows="true"
         tools:context="com.inov8.falconpayconsumer.activities.bookme.MovieDetailsActivity"&gt;
  
          &lt;android.support.design.widget.AppBarLayout
              android:layout_width="match_parent"
              android:layout_height="250dp"
              android:fitsSystemWindows="true"
              android:theme="@style/AppTheme"&gt;
  
              &lt;android.support.design.widget.CollapsingToolbarLayout
                  android:id="@+id/collapsing_toolbar"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:fitsSystemWindows="true"
                  app:contentScrim="?attr/colorPrimary"
                  app:expandedTitleMarginEnd="64dp"
                  app:expandedTitleMarginStart="48dp"
                  app:layout_scrollFlags="scroll|exitUntilCollapsed"&gt;
  
                  &lt;ImageView
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:fitsSystemWindows="true"
                      android:minHeight="100dp"
                      android:scaleType="matrix"
                      android:src="@drawable/gods_of_egypt"
                      app:layout_collapseMode="parallax" /&gt;
  
                  &lt;android.support.v7.widget.Toolbar
                      android:id="@+id/toolbar"
                      android:layout_width="match_parent"
                      android:layout_height="?attr/actionBarSize"
                      app:layout_collapseMode="pin"&gt;
  
                  &lt;/android.support.v7.widget.Toolbar&gt;
  
              &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
          &lt;/android.support.design.widget.AppBarLayout&gt;
  
          &lt;android.support.v4.widget.NestedScrollView
              android:id="@+id/scroll"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:clipToPadding="false"
              app:layout_behavior="@string/appbar_scrolling_view_behavior"&gt;
  
              &lt;FrameLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"&gt;
  
                  &lt;LinearLayout
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:orientation="vertical"&gt;
  
                      &lt;TextView
                          android:id="@+id/title"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:textAppearance="@style/TextAppearance.AppCompat.Headline" /&gt;
  
                      &lt;TextView
                          android:id="@+id/description"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_margin="15dp"
                          android:text="@string/lorem_ipsum"
                          android:textAppearance="@style/TextAppearance.AppCompat.Body1" /&gt;
  
                  &lt;/LinearLayout&gt;
  
              &lt;/FrameLayout&gt;
  
          &lt;/android.support.v4.widget.NestedScrollView&gt;
  
      &lt;/android.support.design.widget.CoordinatorLayout&gt;
  
      &lt;include
          android:id="@+id/header_layout"
          layout="@layout/drawer_layout_list" /&gt;
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>If it is the problem in the default theme of the application them it is <code>&lt;style name="My_App_Theme" parent="Theme.AppCompat.NoActionBar" /&gt;</code>
  In manifest I am using <code>android:theme="@style/AppTheme"</code></p>
  
  <p>and Here is the complete Error shown when drawing this layout</p>
  
  <pre><code>Rendering Problems The following classes could not be instantiated:     - android.support.design.widget.CoordinatorLayout (Open Class, Show Exception, Clear Cache)    
  Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE  Exception Details 
  java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library.   at 
  android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:34)   at android.support.design.widget.CoordinatorLayout.&lt;init&gt;(CoordinatorLayout.java:182)   at 
  android.support.design.widget.CoordinatorLayout.&lt;init&gt;(CoordinatorLayout.java:176)   at 
  java.lang.reflect.Constructor.newInstance(Constructor.java:423)   at 
  android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)   at 
  android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:835)   at 
  android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70) 
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:811)   at 
  android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)   at 
  android.view.LayoutInflater.inflate(LayoutInflater.java:515)   at 
  android.view.LayoutInflater.inflate(LayoutInflater.java:394)
  </code></pre>