由于错误2,GooglePlayServices不可用

Pau*_*ger 6 android google-api google-drive-api google-play-services

我正在尝试在我的Android应用中使用Google云端硬盘.目前我只想在谷歌硬盘上显示文件名.我使用本教程https://developers.google.com/drive/quickstart-android 在我的应用中设置了google云端硬盘帐户,这个https://developers.google.com/drive/v2/reference/files/list检索文件列表.

为此,我必须创建一个异步任务:

private class getCloudContentTask extends AsyncTask<Void, Void, Void> {

    protected void onPostExecute() {
        updateList();
    }

    @Override
    protected Void doInBackground(Void... arg0) {
        cloudFiles = getCloudContent();
        return null;
    }
}
Run Code Online (Sandbox Code Playgroud)

getCloudContent基本上是教程中的retrieveAllFiles函数.

但是我总是收到一些警告和错误,文件将不会显示.

01-09 19:39:31.347: W/dalvikvm(27926): VFY: unable to resolve static field 1488 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
01-09 19:39:31.347: D/dalvikvm(27926): VFY: replacing opcode 0x60 at 0x0004
01-09 19:39:31.446: W/GooglePlayServicesUtil(27926): Google Play services out of date.  Requires 2012100 but found 1015
01-09 19:39:31.446: E/GoogleAuthUtil(27926): GooglePlayServices not available due to error 2
01-09 19:39:31.456: I/System.out(27926): An error occurred: com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException
Run Code Online (Sandbox Code Playgroud)

我有最新的Eclipse Juno安装版本,包括Android SDK和最新的Google Play服务.我使用的是模拟设备.google-play-services.jar位于我项目的参考库中.google drive api v2也包含在所描述的教程中.

任何帮助表示赞赏!

Cla*_*ino 5

如错误消息所示,您模拟图片上的Google Play服务版本不是最新版本.尝试检查是否有更新的Android图像可供您使用.

否则,只需在物理设备而不是模拟器上运行应用程序就更容易了.