我最近将2台机器从Xamarin Forms 1.x升级到2.0。一台机器没问题,Xamarin Forms项目适用于Android。另一台机器有可怕的问题。
我们已经尝试卸载并重新安装所有内容 - Xamarin,Android SDK,所有NuGet软件包 - 很多 - 但是会收到相同的错误消息。
它似乎与Android app compat相关。
复制的步骤是:
以下是错误:
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'
答案 0 :(得分:9)
删除Resource.Designer.cs文件中的所有内容(不是文件本身)并重建。它应该为您重新生成文件,错误将消失。
第一步下一步
确保您的Google支持包全部为23.0.1.3。这是XF 2.0的要求,但它们应该已经通过XF 2.0升级进行了更新。
当其他所有内容都失败时(从我对其他问题的回答中复制)
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
您可能还想添加啜泣,祈祷或诅咒这些步骤:)
最后一件事,如果不起作用,请再次尝试相同,但这次卸载所有NuGet包和组件而不是重新安装。这之前对我有用。
然后确保您的缓存是干净的(C:\ Users \ yourusername \ AppData \ Local \ Xamarin)。我通常删除这里的所有内容,以便重建它们。
我很遗憾不得不做上面列出的所有事情,以使Resource.Designer.cs在以前的场合工作。