如何解决GooglePlayServices 是否可用 SERVICE_INVALID
我有一个应该显示谷歌地图控件的 Xamarin 应用程序。我尝试让它在 Android 中运行,但我有一些错误。
在我看来,该错误似乎与 Google Play 服务有关,因此我尝试检查状态,但收到错误消息“SERVICE_INVALID”。
使用模拟器,当我使用 Nougat 7.1 时它可以工作,但不能使用版本 9 ...
我使用以下代码:
public bool IsPlayServicesAvailable()
{
// Verifies that Google Play services is installed and enabled on this device,and
// that the version installed on this device is no older than the one required by this client.
var resultCode = GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable(this);
if (resultCode != ConnectionResult.Success)
{
if (GoogleApiAvailability.Instance.IsUserResolvableError(resultCode))
{
System.Console.WriteLine(GoogleApiAvailability.Instance.GetErrorString(resultCode));
//Log.Debug(TAG,GoogleApiAvailability.Instance.GetErrorString(resultCode));
}
else
{
//Log.Debug(TAG,"This device is not supported");
Finish();
}
return false;
}
//Log.Debug(TAG,"Google Play Services is available.");
return true;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。