简体   繁体   English

谷歌驱动器快速入门示例错误在Android

[英]google drive quickstart sample error in android

I just tried google drive quickstart sample. 我刚刚尝试了Google Drive快速入门示例。 In the video it seems that its working fine, however when i tried it myself i got this: 在视频中,它似乎工作正常,但是当我自己尝试时,我得到了:

在此处输入图片说明

and the error is this: 错误是这样的:

01-09 01:17:23.719: E/AndroidRuntime(1002): FATAL EXCEPTION: main
01-09 01:17:23.719: E/AndroidRuntime(1002): java.lang.NoSuchMethodError: com.google.android.gms.common.AccountPicker.newChooseAccountIntent
01-09 01:17:23.719: E/AndroidRuntime(1002):     at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.newChooseAccountIntent(GoogleAccountCredential.java:171)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at com.example.mydrivequickstart.MainActivity.onCreate(MainActivity.java:40)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at android.app.Activity.performCreate(Activity.java:5104)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at android.os.Handler.dispatchMessage(Handler.java:99)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at android.os.Looper.loop(Looper.java:137)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at android.app.ActivityThread.main(ActivityThread.java:5039)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at java.lang.reflect.Method.invokeNative(Native Method)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at java.lang.reflect.Method.invoke(Method.java:511)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-09 01:17:23.719: E/AndroidRuntime(1002):     at dalvik.system.NativeStart.main(Native Method)

I followed exactly the instructions. 我完全按照指示进行。 I dloaded na google plugin and add the external jar which is ggoogle-play-services.jar and in google plugin I add the google api drive which is V2. 我卸载了Google插件,并添加了外部jar,即ggoogle-play-services.jar ,在Google插件中,我添加了Google api驱动器,即V2。 the application name and package name are all the same as in my google api console. 应用程序名称和程序包名称都与我的Google api控制台中的相同。 I know the nosuchmethoderror as i search it in google before posting this question.However I still dont know why am i getting this because i followed the instructions as it is. 我知道nosuchmethoderror,因为我在发布此问题之前在google中搜索了它。但是我仍然不知道为什么会得到这个错误,因为我按照说明进行操作。 I cant figure out why i am getting this error. 我不知道为什么我得到这个错误。 Any idea? 任何想法? I appreciate any help. 感谢您的帮助。 Thank you. 谢谢。

I got it. 我知道了。 I should not follow the video. 我不应该观看视频。 The jar he uses is not correct. 他使用的罐子不正确。 I import the library from extras folder in android sdk and use it as my lib in my project. 我从android sdk的extras文件夹导入该库,并将其用作我的项目中的lib。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM