Resource.Designer.cs:“资源...不包含...的定义".

编程入门 行业动态 更新时间:2024-10-25 16:22:23
本文介绍了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):

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

  • Build --> Clean all
  • Uninstall every NuGet package from every project (Droid, iOS, SyncLibrary (own library for SQL server communication) and UITest)
  • Delete everything inside of file "Resource.Designer.cs"
  • Close Xamarin
  • Install every package in the SDK Manager for every version
  • Delete the packages folder of the solution
  • Delete content of /Users/Username/.local/share/Xamarin
  • Delete content of /Users/Username/.local/share/NuGet/cache
  • Start Xamarin
  • Add Newtonsoft.Json package to SyncLibrary
  • 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:“资源...不包含...的定义".

    本文发布于:2023-11-09 10:28:13,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1572137.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:不包含   定义   资源   Designer   Resource

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!