gpt4 book ai didi

集成 Spreadsheets API 的 Android 应用程序

转载 作者:行者123 更新时间:2023-11-29 20:59:19 26 4
gpt4 key购买 nike

我的应用程序从用户帐户访问电子表格,之前通过 Google Plus 登录按钮进行身份验证,在 Google API 控制台中选择了所有适当的范围和凭据,并且我有一个登录的 GoogleApiClient,我可以使用它访问用户资料信息。

当我尝试初始化 SpreadSheetService 对象时:

SpreadsheetService service = new SpreadsheetService("SpreadSheetImport-v1");

我得到与类 com.google.common.collect.Maps 相关的异常:

10-30 13:50:34.280: D/SHEETS(17433): TRYING TO GET SPREADSHEET LIST!
10-30 13:50:34.280: D/AndroidRuntime(17433): Shutting down VM
10-30 13:50:34.280: E/AndroidRuntime(17433): FATAL EXCEPTION: main
10-30 13:50:34.280: E/AndroidRuntime(17433): Process: com.pazodediarada.dc, PID: 17433
10-30 13:50:34.280: E/AndroidRuntime(17433): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/common/collect/Maps;
10-30 13:50:34.280: E/AndroidRuntime(17433): at com.google.gdata.wireformats.AltRegistry.<init>(AltRegistry.java:118)
10-30 13:50:34.280: E/AndroidRuntime(17433): at com.google.gdata.wireformats.AltRegistry.<init>(AltRegistry.java:100)
10-30 13:50:34.280: E/AndroidRuntime(17433): at com.google.gdata.client.Service.<clinit>(Service.java:555)
10-30 13:50:34.280: E/AndroidRuntime(17433): at com.pazodediarada.dc.SpreadSheetImport.getSpreadSheetDeutschList(SpreadSheetImport.java:356)
10-30 13:50:34.280: E/AndroidRuntime(17433): at com.pazodediarada.dc.SpreadSheetImport.onClick(SpreadSheetImport.java:146)
10-30 13:50:34.280: E/AndroidRuntime(17433): at android.view.View.performClick(View.java:4438)
10-30 13:50:34.280: E/AndroidRuntime(17433): at android.view.View$PerformClick.run(View.java:18422)
10-30 13:50:34.280: E/AndroidRuntime(17433): at android.os.Handler.handleCallback(Handler.java:733)
10-30 13:50:34.280: E/AndroidRuntime(17433): at android.os.Handler.dispatchMessage(Handler.java:95)
10-30 13:50:34.280: E/AndroidRuntime(17433): at android.os.Looper.loop(Looper.java:136)
10-30 13:50:34.280: E/AndroidRuntime(17433): at android.app.ActivityThread.main(ActivityThread.java:5001)
10-30 13:50:34.280: E/AndroidRuntime(17433): at java.lang.reflect.Method.invoke(Native Method)
10-30 13:50:34.280: E/AndroidRuntime(17433): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
10-30 13:50:34.280: E/AndroidRuntime(17433): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
10-30 13:50:34.280: E/AndroidRuntime(17433): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.common.collect.Maps" on path: DexPathList[[zip file "/data/app/com.pazodediarada.dc-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.pazodediarada.dc-2, /vendor/lib, /system/lib]]
10-30 13:50:34.280: E/AndroidRuntime(17433): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
10-30 13:50:34.280: E/AndroidRuntime(17433): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
10-30 13:50:34.280: E/AndroidRuntime(17433): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
10-30 13:50:34.280: E/AndroidRuntime(17433): ... 14 more
10-30 13:50:34.280: E/AndroidRuntime(17433): Suppressed: java.lang.ClassNotFoundException: com.google.common.collect.Maps
10-30 13:50:34.280: E/AndroidRuntime(17433): at java.lang.Class.classForName(Native Method)
10-30 13:50:34.280: E/AndroidRuntime(17433): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
10-30 13:50:34.280: E/AndroidRuntime(17433): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
10-30 13:50:34.280: E/AndroidRuntime(17433): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
10-30 13:50:34.280: E/AndroidRuntime(17433): ... 15 more
10-30 13:50:34.280: E/AndroidRuntime(17433): Caused by: java.lang.NoClassDefFoundError: Class "Lcom/google/common/collect/Maps;" not found
10-30 13:50:34.280: E/AndroidRuntime(17433): ... 19 more

我的 IDE 是 Eclipse ADT,我已经按照 Google Sheets Api 导入了谷歌 API 库,无论是使用那里描述的这种方法还是添加外部 jar ,都获得了相同的结果。

有什么想法吗?

最佳答案

找到解决方案...这还需要添加 google Guava图书馆。还有一个用于 eclipse 的插件。

关于集成 Spreadsheets API 的 Android 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26653691/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com