We have a Xamarin.Android apps built using Xamarin Forms and shared code (.NET Standard 2.0) and trying to build it on our build server where it continuously failing with following errors:
Mobile.Android\Resources\values\styles.xml(2,0): Error APT0000: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
Mobile.Android\Resources\values\styles.xml(2,0): Error APT0000: No resource found that matches the given name: attr 'colorAccent'.
Mobile.Android\Resources\values\styles.xml(2,0): Error APT0000: No resource found that matches the given name: attr 'colorPrimary'.
Mobile.Android\Resources\values\styles.xml(2,0): Error APT0000: No resource found that matches the given name: attr 'colorPrimaryDark'.
Mobile.Android\Resources\values\styles.xml(2,0): Error APT0000: No resource found that matches the given name: attr 'windowActionBar'.
Mobile.Android\Resources\values\styles.xml(2,0): Error APT0000: No resource found that matches the given name: attr 'windowActionModeOverlay'.
Mobile.Android\Resources\values\styles.xml(2,0): Error APT0000: No resource found that matches the given name: attr 'windowNoTitle'.
Mobile.Android\Resources\values\styles.xml(2,0): Error APT0000: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'.
Mobile.Android\Resources\values\styles.xml(2,0): Error APT0000: No resource found that matches the given name: attr 'colorAccent'.
Mobile.Android\Resources\values\styles.xml(2,0): Error APT0000: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
Mobile.Android\Resources\values\styles.xml(2,0): Error APT0000: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'.
Following are notable points:
- We recently moved from Xamarin.iOS and Xamarin.Android UI to Xamarin.Forms UI. The build agent is able to build the previous builds successfully.
- The app builds successfully on our local dev machines (tried on 2 different) in release mode.
- Also tried building the code by simply downloading the app on Build Server and running via VS and it build successfully.
- Xamarin.Android.Support.v7 and Xamarin.Android.Support.v4 are included.
Solutions I've tried so far include:
- Making sure the Support libraries and target framework are on same level. (API 25)
- Making sure the shared code builds before android code.
- Updated the Android SDKs on Build Server. Android config is same as on my dev machine.
- Tried with different version of API
- Cleared content of C:\Users\Admin\AppData\Local\xamarin
- Rebuild, Restart, Clean bin and obj and other regular stuff
Been struggling with this for 2 days now. ANy help will be much appreciated.