【问题标题】:Xamarin.Forms : No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version')Xamarin.Forms:找不到与给定名称匹配的资源(在“值”处,值为“@integer/google_play_services_version”)
【发布时间】:2017-02-02 19:06:27
【问题描述】:

我在 Visual Studio 中通过 Xamarin 开发应用程序,第一次尝试时遇到以下错误:

找不到与给定名称匹配的资源(在“值”处,值为“@integer/google_play_services_version”)。

请安装包:SDK 安装程序中提供的“GPS Base”。

在 Stack Overflow 甚至在 Xamarin 论坛中被问了很多。例如以下链接:

How to fix "No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version')"

https://forums.xamarin.com/discussion/47224/no-resource-found-that-matches-the-given-name-with-value-integer-google-play-services-version

How to fix"No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version)" in Xamarin android c#

但是没有人对此有可靠和正确的答案。

有没有人可以帮我解决这个错误?

提前致谢!

【问题讨论】:

  • 它应该在构建时自动添加到您的清单中。您在项目中安装了哪些 NuGet 或组件?
  • 没什么,我只是尝试构建模板项目,当你要创建一个新项目时由向导创建的模板项目
  • 查看模板自带的包
  • @Cheesebaron :这不是那么容易的家伙!查看我在 Xamarin 论坛上提供的链接,您会发现这是大多数开发人员都遇到的问题。如果你有时间,我们可以设置一个时间,你可以通过 TeamViewer 连接到我的电脑,看看这里发生了什么......

标签: xamarin xamarin.forms


【解决方案1】:

根据消息:

请安装包:SDK 安装程序中提供的“GPS Base”。

我建议您确保在 Android SDK 管理器中安装了 Google Play 服务。在 VS Tools->Android->Android SDK Manager 中会打开 Android SDK Manager。向下滚动到“附加”部分并查找 Google Play 服务并确保已安装。事实上,我会确保所有的 Google Play XXX 软件包都与 Google 存储库一起安装。

【讨论】:

  • 您好 jgoldberger,我在 SDK 管理器的 Extras 部分安装了所有可用的包,但仍然有相同的错误。如果你看这个链接:forums.xamarin.com/discussion/47224/…,你可以看到这个错误的来源仍然未知。
  • 错误列表中出现的其他一些错误是:未找到与给定名称匹配的资源:attr 'colorPrimaryDark'。或未找到与给定名称“Theme.AppCompat.Light.NoActionBar”匹配的资源。 :-|
【解决方案2】:

好吧,当我删除 Visual Studio 2015 Update 3 并安装新版本的 Visual Studio 2017 企业版时,我不再遇到上述问题。看来新发布的 Visual Studio 版本足够智能,可以为我查找和管理所有这些包!

【讨论】:

    【解决方案3】:

    我遇到了同样的问题。即使从众多博客中尝试了如此多的答案,也没有一个奏效。我可以通过右键单击 Xamarin 解决方案的 Android 项目并通过选择管理 NuGet 包来安装包来安装 Xamarin.GooglePlayServices.Maps nuget 包来解决此问题。早些时候,我使用工具 > NuGet 包管理器 > 管理 NuGet 包来安装包以获取解决方案。希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 2015-06-16
      • 1970-01-01
      • 2017-05-15
      • 2016-11-04
      • 2014-07-18
      • 2021-01-22
      • 1970-01-01
      • 2015-03-17
      • 1970-01-01
      相关资源
      最近更新 更多