[No response on stackoverflow, so moved the post to here.]
On a Xamarin.Android project that was working fine (on emulators, real devices, released to Google Play Store), recent upgrade of Xamarin Studio and/or referenced Android SDK caused build errors in Resources/values/Styles.xml, on the theme on the main activity.
Styles.xml starts with:
<?xml version="1.0" encoding="UTF-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="MyTheme" parent="Theme.MyTheme"> </style> <style name="Theme.MyTheme" parent="@style/Theme.AppCompat.NoActionBar"> <item name="windowNoTitle">true</item> <item name="android:windowActionBarOverlay">false</item>
Styles.xml generates ten errors on these two elements and their sub-items:
Error retrieving parent for item: No resource found that matches the given name '@style/Theme.AppCompat.NoActionBar'.
Error retrieving parent for item: No resource found that matches the given name '@style/Theme.AppCompat.Light.Dark.ActionBar
.. similar errors, referring to Theme.AppCompat.. ThemeOverlay.AppCompat.., Widget.AppCompat..
Project includes up-to-date packages
(not bothering to list exactly all the projects, as this has been working without problems for over a year)
"References / From Packages" also lists all those "Support" packages.
Android SDK Manager:
Android SDK Tools - 25.2.5
Android SDK Platform-tools - 25.0.3
Android 7.1.1 (API 25)
. SDK Platform - API 25, Rev 3
Google APIs Intel x86 Atom System Image - API 25, Rev 3
.. various older stuff ..
Android Support Repository - 44
. NOTE: that wasn't originally installed, as we use Xamarin.Android.Support projects instead; but added it as one attempt to fix these errors.
Minimum SDK: API 21.
Target SDK: API 25.
NOTE: Our minimum is now 21, so we could be referring to "Theme.Material" rather than "Theme.AppCompat". However, that should not matter - and I tried that change, with no improvement. Tried various combinations just in case:
="Theme.AppCompat.NoActionBar" ="@style/Theme.AppCompat.NoActionBar" ="@android:Theme.AppCompat.NoActionBar" ="@android:style/Theme.AppCompat.NoActionBar" ="Theme.Material.NoActionBar" ="@style/Theme.Material.NoActionBar" ="@android:Theme.Material.NoActionBar"
.. no change. So it isn't like some change in configuration or API target changed HOW we need to refer to this (I might have changed minimum or target API while trying to get this to work; I'm a bit vague as to whether should stop using AppCompat; and as you can see, I'm vague on when to use "android:" and "@style/") .. its as if
Theme.AppCompat are not there at all.
Cleaned project, Rebuilt, rebooted pc .. I've done everything except "reinstall" xamarin studio and android. Which I hesitate to do, because that seems to waste half a day or more, getting every detail right, including the paths as we expect them, and associated technologies such as Intel HAXM.
(Reinstall will be my next attempt, but I'd rather find out WHAT has happened. Besides, reinstall won't fix it, if it is a problem with updated stuff, or with some configuration detail I've overlooked.)
What else can I check/update/try-different-settings?