数百个Resource.Designer.cs在最新的Xamarin Forms 2.2.0.45上生成错误 [英] Hundreds of Resource.Designer.cs build errors on latest Xamarin Forms 2.2.0.45

查看:67
本文介绍了数百个Resource.Designer.cs在最新的Xamarin Forms 2.2.0.45上生成错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个新的Xamarin Forms解决方案设置,其中包含PCL,一个iOS应用程序(构建良好)和一个Android项目. Android项目是最新的,用于Xamarin Forms(2.2.0.45)的最新Nuget软件包与PCL项目匹配.但是,当我构建项目时,Resource.Designer.cs文件中出现了500多个错误.

I have a new Xamarin Forms solution setup with a PCL, an iOS app (which builds fine), and an Android project. The Android project is up to date with the latest Nuget packages for Xamarin Forms (2.2.0.45) to match the PCL project. However when I build the project I'm getting over 500 errors in the Resource.Designer.cs file.

我尝试了所有在网上找到的建议,例如删除文件并在构建过程中重新生成它.检查.csproj文件中的标记,并且该标记在那里.

I've tried all the suggestions that I've found online, such as deleting the file and having it regenerated during the Build. Checking the .csproj file for the tag and it's there.

Xamarin论坛没有任何答案,有些人已经提交了错误报告.我无法想象Xamarin Forms上不会有一个干净的新Android项目. PCL和iOS应用程序运行正常,没有错误.

Xamarin Forums don't have any answers, some people have filed bug reports. I can't imagine having a clean new Android project on Xamarin Forms won't build. The PCL and iOS app are running fine and have no errors.

示例构建输出如下:

1> C:\ MyApp \ Droid \ Resources \ Resource.Designer.cs(39,124,39,130​​):错误CS0117:'Resource.Animation'不包含'fab_in'的定义1> C:\ MyApp \ Droid \ Resources \ Resource.Designer.cs(40,125,40,132):错误CS0117:'Resource.Animation'不包含'fab_out'的定义1> C:\ MyApp \ Droid \ Resources \ Resource.Designer.cs(41,129, 41,140):错误CS0117:'Resource.Animation'不包含'snackbar_in'的定义1> C:\ MyApp \ Droid \ Resources \ Resource.Designer.cs(42,130,42,142):错误CS0117:'Resource.Animation'不包含'snackbar_out'的定义1> C:\ MyApp \ Droid \ Resources \ Resource.Designer.cs(87,125,87,132):错误CS0117:'Resource.Attribute'不包含'barSize'的定义1> C:\ MyApp \ Droid \ Resources \ Resource.Designer.cs(125,145,125,172):错误CS0117:'Resource.Attribute'不包含'disableChildrenWhenDisabled'的定义1> C:\ MyApp \ Droid \ Resources \ Resources \ Designer.cs. cs(192,136,192,154):错误CS0117:"Resource.Attribute"没有包含'middleBarArrowSize'1> C:\ MyApp \ Droid \ Resources \ Resource.Designer.cs(204,133,204,148)的定义:错误CS0117:'Resource.Attribute'不包含'popupPromptView'1> C:\ MyApp的定义\ Droid \ Resources \ Resource.Designer.cs(211,124,211,130):错误CS0117:'Resource.Attribute'不包含'提示'的定义1> C:\ MyApp \ Droid \ Resources \ Resource.Designer.cs(228,129,228,140) :错误CS0117:'Resource.Attribute'不包含'spinnerMode'的定义1> C:\ MyApp \ Droid \ Resources \ Resource.Designer.cs(282,139,282,160):错误CS0117:'Resource.Attribute'不包含'topBottomBarArrowSize'的定义1> C:\ MyApp \ Droid \ Resources \ Resource.Designer.cs(337,121,337,132):错误CS0117:'Resource.Color'不包含'error_color'的定义

1>C:\MyApp\Droid\Resources\Resource.Designer.cs(39,124,39,130): error CS0117: 'Resource.Animation' does not contain a definition for 'fab_in' 1>C:\MyApp\Droid\Resources\Resource.Designer.cs(40,125,40,132): error CS0117: 'Resource.Animation' does not contain a definition for 'fab_out' 1>C:\MyApp\Droid\Resources\Resource.Designer.cs(41,129,41,140): error CS0117: 'Resource.Animation' does not contain a definition for 'snackbar_in' 1>C:\MyApp\Droid\Resources\Resource.Designer.cs(42,130,42,142): error CS0117: 'Resource.Animation' does not contain a definition for 'snackbar_out' 1>C:\MyApp\Droid\Resources\Resource.Designer.cs(87,125,87,132): error CS0117: 'Resource.Attribute' does not contain a definition for 'barSize' 1>C:\MyApp\Droid\Resources\Resource.Designer.cs(125,145,125,172): error CS0117: 'Resource.Attribute' does not contain a definition for 'disableChildrenWhenDisabled' 1>C:\MyApp\Droid\Resources\Resource.Designer.cs(192,136,192,154): error CS0117: 'Resource.Attribute' does not contain a definition for 'middleBarArrowSize' 1>C:\MyApp\Droid\Resources\Resource.Designer.cs(204,133,204,148): error CS0117: 'Resource.Attribute' does not contain a definition for 'popupPromptView' 1>C:\MyApp\Droid\Resources\Resource.Designer.cs(211,124,211,130): error CS0117: 'Resource.Attribute' does not contain a definition for 'prompt' 1>C:\MyApp\Droid\Resources\Resource.Designer.cs(228,129,228,140): error CS0117: 'Resource.Attribute' does not contain a definition for 'spinnerMode' 1>C:\MyApp\Droid\Resources\Resource.Designer.cs(282,139,282,160): error CS0117: 'Resource.Attribute' does not contain a definition for 'topBottomBarArrowSize' 1>C:\MyApp\Droid\Resources\Resource.Designer.cs(337,121,337,132): error CS0117: 'Resource.Color' does not contain a definition for 'error_color'

推荐答案

我通过安装以下Nuget软件包-Xamarin.Android.Support.Design,Xamarin.Android.Support.v13,Xamarin.Android.Support.v4, Xamarin.Android.Support.v7.AppCompat,Xamarin.Android.Support.v7.CardView,Xamarin.Android.Support.v7.GridLayout,Xamarin.Android.Support.v7.MediaRouter,Xamarin.Android.Support.v7.Palette, Xamarin.Android.Support.v7.RecyclerView,Xamarin.Android.Support.v8.RenderScript,Xamarin.Android.Support.Vector.Drawable,以及@Clowning的答案,即为缺少的资源添加部分类.签入,再也不会碰到这个项目的烦恼!

I solved this by installing these Nuget packages -Xamarin.Android.Support.Design, Xamarin.Android.Support.v13, Xamarin.Android.Support.v4, Xamarin.Android.Support.v7.AppCompat, Xamarin.Android.Support.v7.CardView, Xamarin.Android.Support.v7.GridLayout, Xamarin.Android.Support.v7.MediaRouter, Xamarin.Android.Support.v7.Palette, Xamarin.Android.Support.v7.RecyclerView, Xamarin.Android.Support.v8.RenderScript, Xamarin.Android.Support.Vector.Drawable, and also @Clowning answer of adding a partial class for the missing resources. CHECKED IN, NEVER TO TOUCH NUGET ON THIS PROJECT AGAIN!

这篇关于数百个Resource.Designer.cs在最新的Xamarin Forms 2.2.0.45上生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆