Steve Chadbourne Steve Chadbourne - 5 months ago 54
Android Question

Android Resource issues after upgrading to Xamarin Forms 2.0

I have recently upgraded 2 machines from Xamarin Forms 1.x to 2.0. One machine is OK and Xamarin Forms projects build fine for Android. The other machine is having dreadful issues.

We have tried uninstalling and re-installing everything - Xamarin, Android SDK, all NuGet packages - the lot - but get the same error messages.

It seems to be related to Android app compat stuff.

Steps to replicate are:


  1. Create new Forms 1.3 project - compile and run - all OK

  2. Upgrade project from Forms 1.3 to 2.0 - issues



Here are the errors:

2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1290,119,1290,143): error CS0117: 'Resource.Styleable' does not contain a definition for 'SnackbarLayout_elevation'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1291,130,1291,165): error CS0117: 'Resource.Styleable' does not contain a definition for 'SnackbarLayout_maxActionInlineWidth'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1308,104,1308,113): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1309,118,1309,141): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabBackground'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1310,120,1310,145): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabContentStart'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1311,115,1311,135): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabGravity'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1312,122,1312,149): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabIndicatorColor'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1313,123,1313,151): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabIndicatorHeight'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1314,116,1314,137): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabMaxWidth'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1315,116,1315,137): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabMinWidth'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1316,112,1316,129): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabMode'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1317,115,1317,135): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabPadding'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1318,121,1318,147): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabPaddingBottom'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1319,118,1319,141): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabPaddingEnd'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1320,120,1320,145): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabPaddingStart'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1321,118,1321,141): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabPaddingTop'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1322,125,1322,155): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabSelectedTextColor'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1323,122,1323,149): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabTextAppearance'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1324,117,1324,139): error CS0117: 'Resource.Styleable' does not contain a definition for 'TabLayout_tabTextColor'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1331,110,1331,125): error CS0117: 'Resource.Styleable' does not contain a definition for 'TextInputLayout'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1332,123,1332,151): error CS0117: 'Resource.Styleable' does not contain a definition for 'TextInputLayout_android_hint'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1333,132,1333,169): error CS0117: 'Resource.Styleable' does not contain a definition for 'TextInputLayout_android_textColorHint'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1334,123,1334,151): error CS0117: 'Resource.Styleable' does not contain a definition for 'TextInputLayout_errorEnabled'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1335,130,1335,165): error CS0117: 'Resource.Styleable' does not contain a definition for 'TextInputLayout_errorTextAppearance'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1336,131,1336,167): error CS0117: 'Resource.Styleable' does not contain a definition for 'TextInputLayout_hintAnimationEnabled'
2>d:\Documents\Visual Studio 2015\Projects\App4\App4\App4.Droid\Resources\Resource.Designer.cs(1337,129,1337,163): error CS0117: 'Resource.Styleable' does not contain a definition for 'TextInputLayout_hintTextAppearance'

Answer

Delete everything inside your Resource.Designer.cs file (not the file itself) and rebuild. It should regenerate the file for you and the errors will disappear.

First next step

Make sure your Google support packages are all at 23.0.1.3. Thats a requirement for XF 2.0 but they should have been updated with the XF 2.0 upgrade.

When all else is failing (copied across from my answer to another question)

1. Clean solution
2. update-package -reinstall (can use -project just for your Android project)
3. Delete Resource.Designer.cs contents again
4. Restart Visual Studio
5. Rebuild once again

You might also want to add sobbing, praying or cursing in with those steps :)

One final thing, if that doesn't work, try the same again but this time uninstalling all NuGet packages and components instead of a reinstall. That has worked for me before.

Then make sure your cache's are clean (C:\Users\yourusername\AppData\Local\Xamarin). I normally delete everything in here so it can rebuild them.

I have unfortunately had to do everything listed above before to get the Resource.Designer.cs to work in previous occasions.

Comments