I'm trying to use the CoordinatorLayout
in my Xamarin.Android app. I've been using a custom theme with Theme.Material.Light
as its parent, which worked fine before I added the CoordinatorLayout
. When I add it, I get an error telling me I have to use a Theme.AppCompat
theme, but as soon as I do the app fails to build and gives me the following error:
/{project directory}/Resources/values/Styles.xml(0,0):
Error APT0000: Error retrieving parent for item:
No resource found that matches the given name
'@android:style/Theme.AppCompat'. (APT0000) (TnpApp.Android)
This answer suggests installing the major version of the support library that matches the Android SDK I'm using. I've tried this (I think I did everything correctly), but it doesn't help.
Does anyone have any ideas?
I'm using Xamarin Studio on Mac.
UPDATE 1
I tried the following code in MainActivity.cs
in a clean Xamarin.Android project, and build fails with the same error.
namespace ThemeTest
{
[Activity(Label = "ThemeTest", MainLauncher = true, Icon = "@mipmap/icon", Theme = "@android:style/Theme.AppCompat.Light")]
public class MainActivity : Activity
{
// ...
}
}
UPDATE 2
I removed all the folders from /user/.local/share/Xamarin
except for Mono for Android
and zips
as suggested in this answer. I closed Xamarin Studio and reopened it. I tried to deploy the app, and Xamarin reinstalled all the packages but the build failed with the original error.