NoClassDefFoundErrror与谷歌驱动器 [英] NoClassDefFoundErrror with Google Drive

查看:337
本文介绍了NoClassDefFoundErrror与谷歌驱动器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,有谷歌驱动器包括在内,这是所有工作完全正常。然后,我执行了Android SDK的升级和Eclipse ADT插件和谷歌Drivie不再起作用,我不明白为什么。

I've got a project which had Google Drive included and it was all working perfectly fine. Then I performed an upgrade of the Android SDK and Eclipse ADT Plugin and Google Drivie no longer works and I can't understand why.

我添加驱动器API到我的项目以及谷歌播放服务和蜱的复选框出口。我做了一个干净的构建,我已经删除了我的应用程序的bin目录下,重新启动Eclipse中,重新做了干净的构建,但只要我跑我的应用程序应该显示谷歌帐户选择应用程序崩溃的部分。

I've added the Drive API to my project as well as Google Play Services and tick on the checkbox to export. I've done a clean build, I've deleted the bin directory of my app, restarted eclipse, re-did the clean build but as soon as I run the section of my app which should show the google account chooser the app crashes.

下面是在logcat中返回的错误

Below is the error returned in the logcat

05-18 17:17:09.089: E/AndroidRuntime(16747): FATAL EXCEPTION: main
05-18 17:17:09.089: E/AndroidRuntime(16747): java.lang.NoClassDefFoundError: com.google.android.gms.common.AccountPicker
05-18 17:17:09.089: E/AndroidRuntime(16747):    at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.newChooseAccountIntent(GoogleAccountCredential.java:171)

不管它看上去那样我尝试它没有任何区别,因此任何帮助将不胜AP preciated。

No matter what I try it doesn't seem to make any difference so any help would be greatly appreciated.

更新
我试过滴答为Android私家藏书导出选项为Raghunandan建议。大多数应用程序的工作,如Dropbox的API,它也被列入该项目,但在执行code的谷歌传动部分,与NoClassDefFoundError的我仍然得到错误。

UPDATE I've tried ticking the export option for Android Private Libraries as Raghunandan suggested. Most of the app is working such as the Dropbox API that is also included in the project but I still get the error when the Google Drive part of the code is executed, with the NoClassDefFoundError.

如果我打勾的订单和放大器中的驱动器API;导出选项卡然后我得到一个错误敏捷装载机]无法执行DEX:多DEX文件定义LCOM /谷歌/ API /客户/ googleapis /扩展/安卓/帐号/ GoogleAccountManag ER;

If I tick the Drive API within the Order & Export Tab I then get an error Dex Loader] Unable to execute dex: Multiple dex files define Lcom/google/api/client/googleapis/extensions/android/accounts/GoogleAccountManag‌​er;

推荐答案

看起来像要导入定义类多个库com.google.api.client.googleapis.extensions.android.accounts.GoogleAccountManager 。考虑软件包管理器,Android的下私家藏书,并尝试打开有.jar文件。你可能会在他们至少有两个发现这个类(其中一人可能是这样的谷歌API的客户端Android的1.13.2-beta.jar )。

Looks like you are importing multiple libraries defining class com.google.api.client.googleapis.extensions.android.accounts.GoogleAccountManag‌er. Look into Package Manager, under Android Private Libraries and try opening .jar files there. You will probably find this class in at least two of them (one of them might be something like google-api-client-android-1.13.2-beta.jar).

尝试排除您的构建路径的jar文件之一。如果你有任何错误,你做。如果有错误,请尝试不包括其他jar文件。如果错误仍然存​​在,你可以尝试打开罐子的拉链和手动删除 GoogleAccountManager.class 文件。

Try excluding one of the jar files from your build path. If you have no errors, you are done. If there are errors, try excluding the other jar file. If errors remain, you can try opening jar as zip and manually deleting the GoogleAccountManager.class file.

这篇关于NoClassDefFoundErrror与谷歌驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆