How to implement google play services using android sdk 17 on xamarin

荒凉一梦 提交于 2019-12-25 05:00:46

问题


I have been trying to implement Google Play services using the steps in https://github.com/xamarin/monodroid-samples/tree/master/MapsAndLocationDemo_v2 and https://github.com/xamarin/monodroid-samples/tree/master/GooglePlayServices

android update project -p "path to project" -t 4 worked

ant debug works, updated project.properties, add Api key

However on build in Xamarin studio 4.0.3 on Mac get this.using Xamarin android 4.6. what package is missing. any advice appreciated. am referencing Mono.android,support.v4

/Users/TheCall/MapView/Components/googleplayservices-9.0/samples/GooglePlayServicesApp/GooglePlayServicesApp/obj/Debug/android/src/mono/com/google/android/gms/appstate/OnSignOutCompleteListenerImplementor.java(34,34): 
Error: package com.google.android.gms.appstate does not exist 

com.google.android.gms.appstate.OnSignOutCompleteListener (GooglePlayServicesApp)

回答1:


I suggest that you should use Google Play Services from http://components.xamarin.com/.

Steps:

  1. Check your Google Play Services API in Android SDK Manager. If it's not rev. 12, update it. If thats not possible then check your revision, and find the appropirate component from Xamarin. They support rev. 9, rev. 10, and rev. 12. If you want to support older devices, download the Froyo version.

  2. Download this component if you are updated to rev. 12: http://components.xamarin.com/view/googleplayservices12/

  3. Unzip it, and reference the downloaded DLL in your project.
  4. Use it like this: http://components.xamarin.com/gettingstarted/googleplayservices12


来源:https://stackoverflow.com/questions/19559849/how-to-implement-google-play-services-using-android-sdk-17-on-xamarin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!