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

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

问题描述

我有一个新的 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.

示例构建输出如下所示:

Example build output looks like this:

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

1>C:MyAppDroidResourcesResource.Designer.cs(39,124,39,130): error CS0117: 'Resource.Animation' does not contain a definition for 'fab_in' 1>C:MyAppDroidResourcesResource.Designer.cs(40,125,40,132): error CS0117: 'Resource.Animation' does not contain a definition for 'fab_out' 1>C:MyAppDroidResourcesResource.Designer.cs(41,129,41,140): error CS0117: 'Resource.Animation' does not contain a definition for 'snackbar_in' 1>C:MyAppDroidResourcesResource.Designer.cs(42,130,42,142): error CS0117: 'Resource.Animation' does not contain a definition for 'snackbar_out' 1>C:MyAppDroidResourcesResource.Designer.cs(87,125,87,132): error CS0117: 'Resource.Attribute' does not contain a definition for 'barSize' 1>C:MyAppDroidResourcesResource.Designer.cs(125,145,125,172): error CS0117: 'Resource.Attribute' does not contain a definition for 'disableChildrenWhenDisabled' 1>C:MyAppDroidResourcesResource.Designer.cs(192,136,192,154): error CS0117: 'Resource.Attribute' does not contain a definition for 'middleBarArrowSize' 1>C:MyAppDroidResourcesResource.Designer.cs(204,133,204,148): error CS0117: 'Resource.Attribute' does not contain a definition for 'popupPromptView' 1>C:MyAppDroidResourcesResource.Designer.cs(211,124,211,130): error CS0117: 'Resource.Attribute' does not contain a definition for 'prompt' 1>C:MyAppDroidResourcesResource.Designer.cs(228,129,228,140): error CS0117: 'Resource.Attribute' does not contain a definition for 'spinnerMode' 1>C:MyAppDroidResourcesResource.Designer.cs(282,139,282,160): error CS0117: 'Resource.Attribute' does not contain a definition for 'topBottomBarArrowSize' 1>C:MyAppDroidResourcesResource.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 答案.签入,永远不要再接触这个项目的 NUGET!

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!

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

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