title: "Something Went Wrong" while opening the layout in design mode
body: <p>I'm very new android development. I'm using Visual Studio 2017 and Xamarin. I'm facing a issue when opening <code>activity_main.axml</code> in the designer. I'm able to debug the app in the emulator this error is only thrown in the design mode.</p>
  
  <h3>Error Log:</h3>
  
  <blockquote>
    <p>Indirect rendering enabled Creating LibraryClassLoader in shadow copy
    path
    C:\Users\Dell\AppData\Local\Temp\AndroidDesignerJars4571381395840691254
    Setting id 2 on newly created ClassLoader</p>
    
    <p>Trying to load class android.support.design.widget.CoordinatorLayout</p>
    
    <p>An exception occured while loading control
    android.support.design.widget.CoordinatorLayout
    java.lang.reflect.InvocationTargetException   at
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at
    mono.android.SessionProjectCallback.instantiateClass(SessionProjectCallback.java:404)
      at
    mono.android.SessionProjectCallback.loadView(SessionProjectCallback.java:204)
      at
    android.view.BridgeInflater.loadCustomView(BridgeInflater.java:337)
      at
    android.view.BridgeInflater.loadCustomView(BridgeInflater.java:348)
      at
    android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:248)
      at
    android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:492)     at
    android.view.LayoutInflater.inflate(LayoutInflater.java:394)  at
    com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:325)
      at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:384)
      at
    com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:270)
      at mono.android.DesignerSession.load(DesignerSession.java:289)  at
    mono.android.DesignerSession.processMessage(DesignerSession.java:657)
      at
    mono.android.MessageListener.executeMessage(MessageListener.java:88)
      at mono.android.MessageListener$Runner.run(MessageListener.java:44)
      at java.lang.Thread.run(Thread.java:748) Caused by:
    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:33)
      at
    android.support.design.widget.CoordinatorLayout.(CoordinatorLayout.java:206)
      at
    android.support.design.widget.CoordinatorLayout.(CoordinatorLayout.java:200)
      ... 20 more</p>
    
    <p>Trying to load class android.support.design.widget.AppBarLayout</p>
    
    <p>An exception occured while loading control
    android.support.design.widget.AppBarLayout
    java.lang.reflect.InvocationTargetException   at
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at
    mono.android.SessionProjectCallback.instantiateClass(SessionProjectCallback.java:404)
      at
    mono.android.SessionProjectCallback.loadView(SessionProjectCallback.java:204)
      at
    android.view.BridgeInflater.loadCustomView(BridgeInflater.java:337)
      at
    android.view.BridgeInflater.loadCustomView(BridgeInflater.java:348)
      at
    android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:248)
      at
    android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
      at
    android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:863)
      at
    android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
      at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)    at
    android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:515)     at
    android.view.LayoutInflater.inflate(LayoutInflater.java:394)  at
    com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:325)
      at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:384)
      at
    com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:270)
      at mono.android.DesignerSession.load(DesignerSession.java:289)  at
    mono.android.DesignerSession.processMessage(DesignerSession.java:657)
      at
    mono.android.MessageListener.executeMessage(MessageListener.java:88)
      at mono.android.MessageListener$Runner.run(MessageListener.java:44)
      at java.lang.Thread.run(Thread.java:748) Caused by:
    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:33)
      at
    android.support.design.widget.AppBarLayout.(AppBarLayout.java:158)
      ... 24 more</p>
    
    <p>Trying to load class android.support.v7.widget.Toolbar</p>
    
    <p>Bridge [resources.resolve.theme] Failed to find style 'toolbarStyle'
    in current theme Bridge [resources.resolve.theme] Failed to find style
    'toolbarStyle' in current theme Bridge [resources.resolve.theme]
    Failed to find style 'toolbarStyle' in current theme Bridge
    [resources.format] You must supply a layout_height attribute. Failed
    to process message Load mono.android.DesignerException:
    java.lang.NullPointerException    at
    mono.android.DesignerException.fromThrowable(DesignerException.java:46)
      at
    mono.android.DesignerSession.checkRenderResultForError(DesignerSession.java:217)
      at mono.android.DesignerSession.load(DesignerSession.java:296)  at
    mono.android.DesignerSession.processMessage(DesignerSession.java:657)
      at
    mono.android.MessageListener.executeMessage(MessageListener.java:88)
      at mono.android.MessageListener$Runner.run(MessageListener.java:44)
      at java.lang.Thread.run(Thread.java:748) Caused by:
    java.lang.NullPointerException</p>
  </blockquote>
  
  <h3>activity_main.axml</h3>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&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"&gt;
      &lt;android.support.design.widget.AppBarLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:theme="@style/AppTheme"&gt;
          &lt;android.support.v7.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;/android.support.design.widget.AppBarLayout&gt;
      &lt;include
          layout="@layout/content_main" /&gt;
      &lt;android.support.design.widget.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;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <h2>Screenshot</h2>
  
  <p><a href="https://i.stack.imgur.com/3b4bV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3b4bV.png" alt="Screenshot of visual studio. As you can see nothing is rendered at all."></a></p>