15

我从google drive sdk开始。我遵循该帖子中描述的步骤。

但我面临的问题Step 3: Create and Configure an Android Project

添加 Google API

我在我的 Eclipse 中找不到选项,所以我为谷歌添加了插件。安装插件后,Eclipse 给出错误,我们现在也更新我的 SDK。因此,为此我更新了我的 SDK,但现在所有项目都在 Eclipse 中给了我错误。我无法运行任何项目。所以我使用了我的旧 SDK。

现在我坚持如何为 Google Drive 创建项目以及如何集成它。

我需要将文件从我的 android 应用程序上传到 Google Drive。

请帮我找到这个。

编辑

现在我成功地创建了没有错误的项目。但是当我运行项目时,它会给我以下错误。

 12-12 11:05:08.788: E/AndroidRuntime(377): java.lang.NoClassDefFoundError: com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential
12-12 11:05:08.788: E/AndroidRuntime(377):  at com.rarenoice.screen.MainActivity.onCreate(MainActivity.java:42)
12-12 11:05:08.788: E/AndroidRuntime(377):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-12 11:05:08.788: E/AndroidRuntime(377):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
12-12 11:05:08.788: E/AndroidRuntime(377):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
12-12 11:05:08.788: E/AndroidRuntime(377):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
12-12 11:05:08.788: E/AndroidRuntime(377):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
12-12 11:05:08.788: E/AndroidRuntime(377):  at android.os.Handler.dispatchMessage(Handler.java:99)
12-12 11:05:08.788: E/AndroidRuntime(377):  at android.os.Looper.loop(Looper.java:123)
12-12 11:05:08.788: E/AndroidRuntime(377):  at android.app.ActivityThread.main(ActivityThread.java:4627)
12-12 11:05:08.788: E/AndroidRuntime(377):  at java.lang.reflect.Method.invokeNative(Native Method)
12-12 11:05:08.788: E/AndroidRuntime(377):  at java.lang.reflect.Method.invoke(Method.java:521)
12-12 11:05:08.788: E/AndroidRuntime(377):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-12 11:05:08.788: E/AndroidRuntime(377):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-12 11:05:08.788: E/AndroidRuntime(377):  at dalvik.system.NativeStart.main(Native Method)

在以下行:-

private GoogleAccountCredential credential;
 credential = GoogleAccountCredential.usingOAuth2(MainActivity.this,
                DriveScopes.DRIVE);
4

1 回答 1

2

您需要将Google Play Services jar 添加到您的项目中,如您所遵循的快速入门指南的第 3 步中所述。

您还可以观看此视频,其中我完成了为 Android 构建相同的快速入门应用程序的所有步骤:http ://www.youtube.com/watch?v=Ied1CjJ0iP0

于 2012-12-13T05:10:20.547 回答