title: Render problem in Preview of Navigation Drawer in Android Studio
body: <p>I am having a problem with Preview of generated Navigation Drawer layout in Android Studio 3.4.</p>
  
  <p>I've tried to change layout Theme or change API version for Preview but none of these seem to help. The Render problem's error trace looks like this:</p>
  
  <pre><code>java.lang.IllegalArgumentException: java.lang.ClassCastException@26b35b5d
  at sun.reflect.GeneratedMethodAccessor306.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at android.animation.PropertyValuesHolder_Delegate.callMethod(PropertyValuesHolder_Delegate.java:108)
  at android.animation.PropertyValuesHolder_Delegate.nCallFloatMethod(PropertyValuesHolder_Delegate.java:143)
  at android.animation.PropertyValuesHolder.nCallFloatMethod(PropertyValuesHolder.java)
  at android.animation.PropertyValuesHolder.access$400(PropertyValuesHolder.java:38)
  at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1387)
  at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:990)
  at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:674)
  at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:637)
  at android.animation.ValueAnimator.start(ValueAnimator.java:1069)
  at android.animation.ValueAnimator.start(ValueAnimator.java:1088)
  at android.animation.ObjectAnimator.start(ObjectAnimator.java:852)
  at android.animation.ValueAnimator.startWithoutPulsing(ValueAnimator.java:1081)
  at android.animation.AnimatorSet.handleAnimationEvents(AnimatorSet.java:1142)
  at android.animation.AnimatorSet.startAnimation(AnimatorSet.java:1227)
  at android.animation.AnimatorSet.start(AnimatorSet.java:729)
  at android.animation.AnimatorSet.start(AnimatorSet.java:684)
  at android.animation.StateListAnimator.start(StateListAnimator.java:188)
  at android.animation.StateListAnimator.setState(StateListAnimator.java:181)
  at android.view.View.drawableStateChanged(View.java:21105)
  at android.widget.ImageView.drawableStateChanged(ImageView.java:1294)
  at com.google.android.material.floatingactionbutton.FloatingActionButton.drawableStateChanged(FloatingActionButton.java:804)
  at android.view.View.refreshDrawableState(View.java:21160)
  at android.view.View.dispatchAttachedToWindow(View.java:18379)
  at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
  at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
  at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
  at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
  at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:42)
  at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:335)
  at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:391)
  at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:195)
  at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:540)
  at com.android.tools.idea.rendering.RenderTask.lambda$inflate$5(RenderTask.java:666)
  at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p><strong>EDIT</strong> 
  When I rebuild the Project or Invalidate Cashes and restart, the Preview appears to work, bud when I close it and reopen it, the Render error appears again.</p>
  
  <p><strong>Activity_main.xml:</strong></p>
  
  <pre><code>&lt;androidx.drawerlayout.widget.DrawerLayout 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:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      tools:openDrawer="start"&gt;
  
      &lt;include
          layout="@layout/app_bar_main"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
      &lt;com.google.android.material.navigation.NavigationView
          android:id="@+id/nav_view"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:fitsSystemWindows="true"
          app:headerLayout="@layout/nav_header_main"
          app:menu="@menu/activity_main_drawer" /&gt;
  
  &lt;/androidx.drawerlayout.widget.DrawerLayout&gt;
  </code></pre>
  
  <p><strong>app_bar_main.xml</strong></p>
  
  <pre><code>&lt;androidx.coordinatorlayout.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"
      tools:context=".MainActivity"&gt;
  
      &lt;com.google.android.material.appbar.AppBarLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
          &lt;androidx.appcompat.widget.Toolbar
              android:id="@+id/toolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:background="?attr/colorPrimary"
              app:popupTheme="@style/AppTheme.PopupOverlay" /&gt;
  
      &lt;/com.google.android.material.appbar.AppBarLayout&gt;
  
      &lt;include layout="@layout/content_main" /&gt;
  
      &lt;com.google.android.material.floatingactionbutton.FloatingActionButton
          android:id="@+id/fab"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="bottom|end"
          android:layout_margin="@dimen/fab_margin"
          app:srcCompat="@android:drawable/ic_dialog_email" /&gt;
  
  &lt;/androidx.coordinatorlayout.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p><strong>content_main.xml</strong></p>
  
  <pre><code>&lt;LinearLayout 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:orientation="vertical"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"
      tools:context=".MainActivity"
      tools:showIn="@layout/app_bar_main"&gt;
  
      &lt;TextView
          android:id="@+id/user_ID"
          android:layout_width="match_parent"
          android:layout_height="wrap_content" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>