No resource found that mach the given name Theme.AppCompat.Light.NoActionBar

12,987

Solution 1

I found my solution by adding AppCompact v7 in the Package of my xamarin studio android project.

Link= https://components.xamarin.com/view/xamandroidsupportv7appcompat

Solution 2

I can't remember if Theme.AppCompat.Light.NoActionBar exists in the first place.

You could do something like this instead:

<style name="MyTheme" parent="Theme.AppCompat.Light">
    <item name="colorPrimary">#2196F3</item>
    <item name="drawerArrowStyle">@style/MyDrawerArrowStyle</item>
    <item name="windowActionBar">false</item>
    <item name="android:windowNoTitle">true</item>
</style>

Solution 3

Here are the steps to fix those issues;

  1. Go to AndroidManifest.xml and add android:targetSdkVersion to 23 under uses-sdk tag.
  2. Go to Project -> General and set Target framework to Android 6.0 (Marshmallow).
  3. Go to Project -> Android Application -> set Target Android version to Android 6.0.

Android version 7.0 is not compiled in latest Xamarin Studio.Right now you can only compile Android project up to Android 6.0.

Share:
12,987

Related videos on Youtube

Bikash
Author by

Bikash

I am a Mobile app developer.My specialization in Android.

Updated on June 04, 2022

Comments

  • Bikash
    Bikash almost 2 years

    I am adding some items in Styles.xml files. However, it is giving me an error.

    Here is my code.

    <?xml version="1.0" encoding="UTF-8" ?>
    <resources>
        <style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
            <item name="colorPrimary">#2196F3</item>
            <item name="drawerArrowStyle">@style/MyDrawerArrowStyle</item>
        </style>
        <style name="MyDrawerArrowStyle"   parent="Widget.AppCompat.DrawerArrowToggle">
            <item name="color">#F5F5F5</item>
            <item name="spinBars">true</item>
        </style>
    </resources>
    

    Error can be seen in the screenshot below

    error screenshot

    1. Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'.
    2. No resource found that matches the given name: attr 'colorPrimary'.
    3. No resource found that matches the given name: attr 'drawerArrowStyle'. 4..No resource found that matches the given name 'Widget.AppCompat.DrawerArrowToggle'.
    4. No resource found that matches the given name: attr 'color'.
    5. No resource found that matches the given name: attr 'spinBars'.
  • shortstuffsushi
    shortstuffsushi about 7 years
    I don't think this is the case anymore.
  • testing
    testing over 5 years
    For my downloaded project there were no valid references. I installed Xamarin.Android.Support.v4, Xamarin.Android.Support.v7.AppCompat and some othere references from the NuGet store. Now the app compiles.