title: Xamarin - Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'
body: <p>I want to create an app with Material Design using Xamarin and Visual Studio. I want to achieve this using the v7 AppCompat library, so my app runs well on older devices. </p>
  
  <p>I followed this tutorial:</p>
  
  <p><a href="https://blog.xamarin.com/android-tips-hello-material-design-v7-appcompat/" rel="nofollow noreferrer">https://blog.xamarin.com/android-tips-hello-material-design-v7-appcompat/</a></p>
  
  <p>and did exact the same. When I go to the <code>Main.axml</code> file(in the <code>Resources/layout</code> folder) there's a dropdown menu where you can select a theme(picture below). However, when I open the dropdown menu, my theme doesn't appear. So I thought it was a good idea to clean and rebuild my project. But when I cleaned the project, I got this error:</p>
  
  <pre><code>Error retrieving parent for item: No resource found that matches the given
  name 'Theme.AppCompat.Light.DarkActionBar'.
  
  No resource found that matches the given name: attr 'colorAccent'.
  No resource found that matches the given name: attr 'colorPrimary'.
  No resource found that matches the given name: attr 'colorPrimaryDark'.
  No resource found that matches the given name: attr 'windowActionBar'.
  No resource found that matches the given name: attr 'windowNoTitle'.
  </code></pre>
  
  <p>How can I fix it and make my theme appear in the dropdown menu?</p>
  
  <p>EDIT:</p>
  
  <p>Here's the code:</p>
  
  <p><code>Main.axml</code></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="match_parent"
  android:layout_height="match_parent"&gt;
  &lt;Button
      android:id="@+id/MyButton"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:text="@string/Hello" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><code>values/styles.xml</code></p>
  
  <pre><code>&lt;resources&gt;
    &lt;style name="MyTheme" parent="MyTheme.Base"&gt;
    &lt;/style&gt;
    &lt;style name="MyTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"&gt;
      &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
      &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
      &lt;item name="colorPrimary"&gt;#2196F3&lt;/item&gt;
      &lt;item name="colorPrimaryDark"&gt;#1976D2&lt;/item&gt;
      &lt;item name="colorAccent"&gt;#FF4081&lt;/item&gt;
    &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p><code>values-v21</code></p>
  
  <pre><code>&lt;resources&gt;
    &lt;style name="MyTheme" parent="MyTheme.Base"&gt;
      &lt;item name="android:windowContentTransitions"&gt;true&lt;/item&gt;
      &lt;item name="android:windowAllowEnterTransitionOverlap"&gt;true&lt;/item&gt;
      &lt;item name="android:windowAllowReturnTransitionOverlap"&gt;true&lt;/item&gt;
      &lt;item name="android:windowSharedElementEnterTransition"&gt;@android:transition/move&lt;/item&gt;
      &lt;item name="android:windowSharedElementExitTransition"&gt;@android:transition/move&lt;/item&gt;
    &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p><code>MainActivity.cs</code></p>
  
  <pre><code>using System;
  using Android.App;
  using Android.Content;
  using Android.Runtime;
  using Android.Views;
  using Android.Widget;
  using Android.OS;
  
  namespace MaterialDesign
  {
      [Activity(Label = "MaterialDesign", MainLauncher = true, Icon = "@drawable/icon")]
      public class MainActivity : Activity
      {
          int count = 1;
  
          protected override void OnCreate(Bundle bundle)
          {
              base.OnCreate(bundle);
              SetContentView(Resource.Layout.Main);
  
              Button button = FindViewById&lt;Button&gt;(Resource.Id.MyButton);
              button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
          }
      }
  }
  </code></pre>
  
  <p>NOTE:</p>
  
  <p>Also when I am using the <code>android.support.v7.widget.Toolbar</code> element, I got the following error: <code>android.support.v7.widget.Toolbar element is not declared</code>.</p>
  
  <p>EDIT(2):</p>
  
  <p>I tried downloading it with the component manager, with a NuGet command(Package Manager Console) and manually download the dll's and reference them, but it still didn't work.
  I also removed the <code>\AppData\Local\Xamarin\Android.Support.v7.AppCompat\23.0.1.3</code> folder and removed the cache, but without succes.</p>
  
  <p>And at the <code>Main.axml</code> file in the designer tab, appears a warning:</p>
  
  <pre><code>This project contains resources that were not compiled successfully,
  rendering might be affected
  </code></pre>
  
  <p>I found out that the problem is with Visual Studio Designer, as it runs properly on my phone. So I asked a new question:<a href="https://stackoverflow.com/questions/39056960/xamarin-android-visual-studio-designer-doesnt-work-with-v7-appcompat-library">Xamarin.Android, Visual Studio - Designer doesn&#39;t work with v7 AppCompat library</a></p>
  
  <p>Here you can download my project: </p>
  
  <p><a href="https://drive.google.com/file/d/0BxiDy9-wQHvzNFRhaTMzelg1WlU/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/0BxiDy9-wQHvzNFRhaTMzelg1WlU/view?usp=sharing</a></p>
  
  <p>(Sorry for bad English, feel free to correct me)</p>