Resource.Designer.cs:“资源...不包含...的定义". [英] Resource.Designer.cs: "Resource ... does not contain a definition for ..."

查看:260
本文介绍了Resource.Designer.cs:“资源...不包含...的定义".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,我为我们的Android版本更新了NuGet软件包(我们目前正在为Android和iOS开发). 更新之后,我无法再构建Android版本.到目前为止,这是我在更新包之后每次都遇到的问题,但是这次我无法解决此问题. 通常,重新启动Xamarin或重新安装NuGet软件包会有所帮助.

today I updated the NuGet packages for our Android version (we are currently developing for Android and iOS). After the updates I cannot build the Android version anymore. This is an issue I faced everytime after updating packes so far, but this time I can't solve this problem. Usually restarting Xamarin or Reinstalling the NuGet packages helped.

我有151条这样的错误消息:

I have 151 error messages like this one:

/用户/用户名/项目/MyAppName/Droid/Resources/Resource.designer.cs(118,118): 错误CS0117:> MyAppName.Droid.Resource.Attribute'不包含 mediaRouteSettingsDrawable的定义"(CS0117)(MyAppName.Droid)

/Users/Username/Projects/MyAppName/Droid/Resources/Resource.designer.cs(118,118): Error CS0117: >MyAppName.Droid.Resource.Attribute' does not contain a definition for mediaRouteSettingsDrawable' (CS0117) (MyAppName.Droid)

以下是我已经尝试解决此问题的所有步骤(按此顺序):

Here are all the steps I already did trying to fix this problem (in this order):

  1. 构建->清理所有
  2. 从每个项目(Droid,iOS,SyncLibrary(用于SQL Server通信的自有库)和UITest)中卸载每个NuGet软件包
  3. 删除文件"Resource.Designer.cs"中的所有内容
  4. 关闭Xamarin
  5. 在SDK Manager中为每个版本安装每个软件包
  6. 删除解决方案的"packages"文件夹
  7. 删除/Users/Username/.local/share/Xamarin的内容
  8. 删除/Users/Username/.local/share/NuGet/cache的内容
  9. 启动Xamarin
  10. 将Newtonsoft.Json包添加到SyncLibrary
  11. 添加Android软件包:仅添加所需的软件包,让NuGet自行解决依赖关系(例如Xamarin.Android.Support,Xamarin.GooglePlayServices等). 已安装的软件包(按此顺序):

  1. Build --> Clean all
  2. Uninstall every NuGet package from every project (Droid, iOS, SyncLibrary (own library for SQL server communication) and UITest)
  3. Delete everything inside of file "Resource.Designer.cs"
  4. Close Xamarin
  5. Install every package in the SDK Manager for every version
  6. Delete the packages folder of the solution
  7. Delete content of /Users/Username/.local/share/Xamarin
  8. Delete content of /Users/Username/.local/share/NuGet/cache
  9. Start Xamarin
  10. Add Newtonsoft.Json package to SyncLibrary
  11. Add Android packages: only add the needed packages, let NuGet resolve dependencies (like Xamarin.Android.Support, Xamarin.GooglePlayServices etc.) on its own. Installed packages (in this order):

Xamarin.Forms ...................................................(2.2.0.45)
Xamarin.Forms.Maps ....................................(2.2.0.45)
XLabs.Forms ............................................(2.0. 5782)
ZXing.Net.Mobile ...(2.0.4.46)
Newtonsoft.Json ....................................(8.0.3)
Xam.Plugin.Geolocator ....................................(3.0.4)

Xamarin.Forms.......................................(2.2.0.45)
Xamarin.Forms.Maps...........................(2.2.0.45)
XLabs.Forms............................................(2.0.5782)
ZXing.Net.Mobile..................................(2.0.4.46)
Newtonsoft.Json....................................(8.0.3)
Xam.Plugin.Geolocator........................(3.0.4)

构建->清理所有

我真的不知道该怎么办了. 感谢您的任何帮助/想法,谢谢.

I really don't know what to do anymore. Any help / ideas are appreciated, thanks in advance.

推荐答案

Xamarin.Forms ...(2.2.0.45)

Xamarin.Forms...(2.2.0.45)

XLabs.Forms .....(2.0.5782)

XLabs.Forms.....(2.0.5782)

这就是重点.最后一个稳定的Xamarin.Forms存在一些问题,当您使用XLabs或其他库时,这些问题可能会导致生成错误.

That's the point. The last stable Xamarin.Forms has some problems that may cause build errors when you're using XLabs or another library.

我知道的唯一解决方案是使用XLabs.Forms的预发行版本-2.2.0-pre02.

The only solution which I know is to use pre-release version of XLabs.Forms - 2.2.0-pre02.

就我而言,我更新了XLabs软件包并清除/重建了我的解决方案.

In my case I updated XLabs packages and cleared/rebuild my solutions.

XLabs问题跟踪器 Xamarin Bugzilla .

这篇关于Resource.Designer.cs:“资源...不包含...的定义".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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