如何构建使用Xamarin.Forms.Maps的Android项目?

时间:2018-03-10 11:56:26

标签: xamarin.forms xamarin.android

我使用.Net Standard 2.0创建了一个新的Xamarin Forms解决方案 它构建好。

然后我添加一个NuGet Xamarin.Forms.Maps:

并出现此Build错误:

Severity    Code    Description Project File    Line    Suppression State
Error       An error occurred trying to install required android components on Project 'eCidadaoMobile.Android'.
Project 'eCidadaoMobile.Android' requires the following components installed on your machine: 
Xamarin.GooglePlayServices.Base
JavaLibraryReference: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-base/8.4.0/play-services-base-8.4.0.aar-8.4.0
AndroidResources: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-base/8.4.0/play-services-base-8.4.0.aar-8.4.0
Xamarin.GooglePlayServices.Basement
JavaLibraryReference: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-basement/8.4.0/play-services-basement-8.4.0.aar-8.4.0
AndroidResources: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-basement/8.4.0/play-services-basement-8.4.0.aar-8.4.0
Xamarin.GooglePlayServices.Maps
JavaLibraryReference: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-maps/8.4.0/play-services-maps-8.4.0.aar-8.4.0
AndroidResources: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-maps/8.4.0/play-services-maps-8.4.0.aar-8.4.0


Please double-click here to install it.

Intallation Errors: XA5207 Please install package: 'GPS Base' available in SDK installer. Java library file 'C:\Users\tonyv\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Base\8.4.0\embedded\classes.jar' doesn't exist.
XA5207 Please install package: 'GPS Basement' available in SDK installer. Java library file 'C:\Users\tonyv\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Basement\8.4.0\content\classes.jar' doesn't exist.
XA5207 Please install package: 'GPS Maps' available in SDK installer. Java library file 'C:\Users\tonyv\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Maps\8.4.0\content\classes.jar' doesn't exist.         0   

如果我双击错误消息,则没有任何反应。

如何以及在何处安装这些必需的文件?

1 个答案:

答案 0 :(得分:1)

在路径C:\Users\UserName\AppData\Local\Xamarin下,删除Xamarin.GooglePlayServices文件夹,以便在下次启动时重新下载它们。