I have a Xamarin.Forms project that consists of a Portable Class Library (PCL), an iOS application and an Android application. When I build the solution, the PCL and the iOS projects build successfully, but the Android application doesn't build at all due to several strange errors as listed below:
error APT0000: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. error APT0000: No resource found that matches the given name: attr 'colorAccent'. error APT0000: No resource found that matches the given name: attr 'colorPrimary'. error APT0000: No resource found that matches the given name: attr 'colorPrimaryDark'. error APT0000: No resource found that matches the given name: attr 'windowActionBar'. error APT0000: No resource found that matches the given name: attr 'windowActionModeOverlay'. error APT0000: No resource found that matches the given name: attr 'windowNoTitle'. error APT0000: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'. error APT0000: No resource found that matches the given name: attr 'colorAccent'.
What's even stranger is when I open NuGet Package Manager, I have a list of updates for the following components:
Xamarin.Android.Support.Design
Xamarin.Android.Support.v4
Xamarin.Android.Support.v7.AppCompat
Xamarin.Android.Support.v7.CardView
Xamarin.Android.Support.v7.MediaRouter
Xamarin.Android.Support.v7.RecyclerView
If I try to update any of the components, I get the following message:
Unable to resolve dependencies. 'Xamarin.Android.Support.Design 24.2.1' is not compatible with 'Xamarin.Forms 2.3.3.180'.
I read somewhere that I should uninstall them completely because I won't have any need for them but if I try to uninstall any of the components, I get the following error:
Unable to uninstall 'Xamarin.Android.Support.v7.RecyclerView.23.3.0' because 'Xamarin.Android.Support.Design.23.3.0' depends on it.
Even the components that don't have any dependencies throw out a similar message if I try to uninstall them. I have searched online but I still can't seem to find a solution. So far, I have tried the following:
Recreating the project completely. This didn't help as the errors continued to appear
Deleting the contents of
C:\Users\Admin\AppData\Local\Xamarin\
. This solution didn't remove the errors at all.
Am I doing something wrong? All I'm doing is selecting the Blank Xaml App (Xamarin.Forms Portable) template in Visual Studio and naming my project. You can hardly make a mistake in that. As soon as I select Build, I get all the errors for the Android project. Is this a problem with Xamarin.Forms that needs to be addressed? Any suggestions on how to solve this issue?