9
votes

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>
   [...]
9
During my work with Xamarin I have experienced lots of "no reason" errors. At first I was trying to solve them on my own (checking Xamarin forums, google) but eventually REINSTALLATION solved them all.NutCracker
I already reinstalled Xamarin...Arnaud F.

9 Answers

18
votes

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!

2
votes

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.

2
votes

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.

1
votes

Visual Studio 2017:

Go to Tools > Options > Xamarin > Android Settings:

Checked the Checkbox Auto Install Android SDKs then click OK button

Closed Visual Studio and open again

0
votes

I simply just did a right click on the Droid project and clicked "Clean". Once I did that my builds and deploys were working fine again.

0
votes

Update Xamarin.Android.Support.v7.AppCompat to newest version did fix the bug.

0
votes

This issue was a fixed for me by updating my NuGet Packages.

Directions: 1) Click Project in the menu bar. 2) Select Update NuGet Packages. 3) Rebuild Solution.

0
votes

I renamed Interviewer_main_drawer.xml to interviewer_main_drawer.xml and everything worked!!!

0
votes

That variables you talk about:

windowNoTitle, windowActionBar, colorPrimary...

Are defined at Resources/values/styles.xml and/or Resources/values-v21/styles.xml if you work with API > 21 (Android 5.0)

Try to change it for:

android:windowNoTitle, android:windowActionBar, android:colorPrimary

If you are using themes from Resources/values/styles.xml but you are working with API > 21 you need to add that android: prefix in order to reference that values correctly.