【发布时间】:2017-01-25 14:41:09
【问题描述】:
我正在尝试在我的 Android 应用中使用 Google 云端硬盘。现在我只是想在谷歌驱动器上显示文件名。我使用本教程 https://developers.google.com/drive/quickstart-android 在我的应用程序中设置谷歌驱动器帐户,并使用 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;
}
}
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
我安装了带有 Android SDK 和最新 Google Play 服务的最新版 Eclipse Juno。我使用模拟设备。 google-play-services.jar 在我项目的参考库中。 google drive api v2 也包含在所描述的教程中。
感谢任何帮助!
【问题讨论】:
-
此错误仅与模拟器有关,在真正的 android 设备上应用程序可以正常工作。但是,由于我没有永久访问 android 设备的权限,我真的很想看到它在模拟器上运行。
-
嘿,保罗!我在设备上遇到了同样的问题,但我的一项活动在 Admob 上运行良好,其他力量关闭,出现上述错误。你能帮我吗?
标签: android google-api google-drive-api google-play-services