Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin - No resource found that match

I recently reinstalled Xamarin after the install of Win10 on my computer.

As always, installing Xamarin and launching a basic Xamarin.Forms app won't work, you need to get some troubles and here are mine :

No resource found that matches the given name: attr 'windowNoTitle'.
No resource found that matches the given name: attr 'colorPrimary'.
No resource found that matches the given name: attr 'windowActionBar'.
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 'colorPrimaryDark'.
No resource found that matches the given name: attr 'colorAccent'.
No resource found that matches the given name: attr 'colorAccent'.
No resource found that matches the given name: attr 'windowActionModeOverlay'. Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'.

I've read several topics that said you need to change the min SDK version to this:

<uses-sdk android:targetSdkVersion="23" android:minSdkVersion="23" /> and have all packets up to date in Android SDK Manager (it's the case too).

But I still get the errors.

Any hint what to change in order to get my basic app working?

EDIT styles.xml exists and looks like :

    <?xml version="1.0" encoding="utf-8" ?>
<resources>

  <style name="MainTheme" parent="MainTheme.Base">
  </style>
  <!-- Base theme applied no matter what API -->
  <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
    <item name="windowNoTitle">true</item>
    <!--We will be using the toolbar so no need to show ActionBar-->
    <item name="windowActionBar">false</item>
   [...]
like image 533
Arnaud F. Avatar asked Feb 12 '17 08:02

Arnaud F.


3 Answers

Ok, got it after many tries, so what to do:

Visual Studio:

  1. Go to Tools > Options > Xamarin > Android Settings : Change to JDK 1.8 (instead of 1.7) !
  2. Close VS

Changing to JDK 1.8 will permanently avoid the error Unsupported major.minor version 52.0

Windows (Local):

  1. Delete all Xamarin.Android.* folders in C:\Users\<User>\AppData\Local\Xamarin
  2. Delete the zips folder in the same location

Windows (in my project folder):

  1. Delete .vs folder
  2. Delete all Xamarin.Android.* folders in packages folder
  3. Delete /obj and /bin folder in the .Droid project

Reopen Visual Studio and rebuild your solution.

On first compile, be patient! Zips are downloaded again in Xamarin/zips and extracted (take at least 5 minutes on my computer).

Wait ... Wait ...

And it's okay, solution is deployed on my smartphone and everything works fine. Thanks to all.

Hope it will help someone else!

like image 105
Arnaud F. Avatar answered Oct 17 '22 04:10

Arnaud F.


i had this issue when i copied the project to another directory

i resolved it by deleting the .vs folder and project.sln.dotsettings.user file and deleted obj and bin folder in .android folder.

like image 3
donprecious iyeritufu Avatar answered Oct 17 '22 02:10

donprecious iyeritufu


Xamarin is great - but that issues are annoying. Please try this:

First solution: - Remove and install again the following library Xamarin.Android.Support.v7.AppCompat

Second solution:

  • Close VS
  • Delete all bin & obj folders in all projects
  • Delete everything in packages folder
  • Delete everything in C:\Users[username]\AppData\Local\Xamarin (Except for mono & android)
  • Open the solutin and rebuild. It should download again all the required libraries.

Hope it helps.

like image 2
Zroq Avatar answered Oct 17 '22 02:10

Zroq