在 Xamarin Android 项目的组件中找不到 Google Play 服务

Can't find Google Play Services in components in Xamarin Android project

我正在尝试将 Google Play Services 组件添加到我的 Xamarin 应用程序中,因为我需要将 google 映射 api 集成到应用程序中。当我尝试在组件中搜索 Google 播放服务时,我找不到 Google 播放服务。我看到其他组件,例如 Google Play services-ads 或 Google Play Services- App Indexing,但没有 Google Play Services。

我在 sdk 管理器中安装了 Google 播放服务客户端:

应用程序的最低 api 级别是 19 级。我仍然找不到 Google Play 服务。这是所有结果的屏幕截图:

编辑

https://forums.xamarin.com/discussion/54499/google-play-services-v27-migration

根据上述网站 google play services-All 不再存在,现在它们是单独的包。所以现在我必须安装 Google Play Services-Maps。

您可以使用 NuGet 下载 Google Play Services Maps 到您的项目。

https://www.nuget.org/packages/Xamarin.GooglePlayServices.Maps/

或者您可以从 component store

下载组件

https://components.xamarin.com/view/googleplayservices-maps

Google Play Services 库一度太大,google 出于多种原因决定将关注点分成较小的包,例如太快达到 64K 引用限制,即使您只为您的应用程序使用了一小部分 API。

您可以在此处阅读有关此主题的概述指南:

https://developers.google.com/android/guides/overview