【问题标题】:Unexpected error code 1500 and unknown issue with Google Play Service error意外错误代码 1500 和 Google Play 服务错误的未知问题
【发布时间】:2014-03-26 07:40:11
【问题描述】:

我正在构建一个 android 应用程序(基于 Google Drive Services)。我已经按照这个Google Drive Service for Android link 来构建我的应用程序。我做对了每一件事。现在,当我运行该应用程序时,它会显示提示消息 “Google Play 服务的未知问题” Google Play Services 也安装在我的手机上(版本:2.3.4 Ginger bred)。

注意:我以编程方式检查了 Google Play 服务,它说 Goolge 播放服务运行良好,但我仍然收到提示消息中的错误。

   //Checking GooglePlayServices working
int isAvailable = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if (isAvailable == ConnectionResult.SUCCESS)
{
  Toast.makeText(this, "Google play services is working well...!", Toast.LENGTH_SHORT).show();
}
else if (GooglePlayServicesUtil.isUserRecoverableError(isAvailable)) 
{
    int RESOLVE_CONNECTION_REQUEST_CODE= 0;
    Dialog dialog = GooglePlayServicesUtil.getErrorDialog(isAvailable, this,RESOLVE_CONNECTION_REQUEST_CODE);
    dialog.show();
}
 else
     Toast.makeText(this, "Can't connect to google play services.", Toast.LENGTH_SHORT).show();

实际上 connectionResult.hasResolution() 没有返回真实值。我在此代码中收到提示错误消息:

if (connectionResult.hasResolution())
 {
//My essential code
  }
else 
  {
     GooglePlayServicesUtil.getErrorDialog(connectionResult.getErrorCode(), this, 0).show();
  }

【问题讨论】:

    标签: android google-play-services


    【解决方案1】:

    根据android文档,错误代码1500的含义如下:


    public static final int DRIVE_EXTERNAL_STORAGE_REQUIRED

    Drive API 需要外部存储(例如 SD 卡),但未安装外部存储。如果用户安装了外部存储(如果不存在)并确保它已安装(这可能涉及禁用 USB 存储模式、格式化存储或设备所需的其他初始化),则此错误是可恢复的。永远不应在具有模拟外部存储的设备上返回此错误。在具有模拟外部存储的设备上,无论设备是否还具有可移动存储,模拟的“外部存储”始终存在。

    【讨论】:

    • 是的,我的手机确实没有 SD 卡,实际上我的手机没有获得 SD 卡。我会在其他设备上检查它,然后告诉你。非常感谢你,你真的很棒。
    • 非常感谢,我解决了我的问题,你是对的。问题是由于我的手机中没有外部存储(SD 卡)。我在其他设备上检查了它,现在它可以工作了。
    猜你喜欢
    • 2014-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-05
    • 1970-01-01
    • 1970-01-01
    • 2017-07-06
    相关资源
    最近更新 更多