我得到一个java.lang.NoClassDefFoundError的上课的时候​​显然是有 [英] I am getting a java.lang.NoClassDefFoundError when the class is clearly there

查看:162
本文介绍了我得到一个java.lang.NoClassDefFoundError的上课的时候​​显然是有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到的时候我试图运行时使用的库出现以下错误:java.lang.NoClassDefFoundError的:com.google.api.client.extensions.android2.AndroidHttp
我加入这个库到我的项目,它是Maven依赖的第一罐(我习惯了,虽然没有Maven的100%)。

I am getting the following error when I am trying to use the library during runtime: java.lang.NoClassDefFoundError: com.google.api.client.extensions.android2.AndroidHttp I have added this library to my project, it is the first jar of the Maven dependencies( I am not 100% used to Maven though).

另外,我的理解是,蚂蚁正在寻找在libs文件夹的罐子,但Maven是使用自己的文件夹,并为其他项目工作正常。所以我lost..any线索/我应该如何解决这将是多少AP preciated帮助!

Also,My understanding is that Ant is looking for the jars in a libs folder, but Maven is using its own folder, and that works fine for an other project. So I am lost..any clues/help on how should I troubleshoot this would be much appreciated!

推荐答案

作为速战速决,通过在 Java构建路径滴答 Maven依赖 - 为了和导出窗口应该解决的NoClassDefFoundError。

As a quick fix, By ticking Maven Dependencies in Java Build Path - Order and Export window should solve NoClassDefFoundError.

根据您连接的截图,它看起来像你的设置(或进口)您在Eclipse中的Andr​​oid项目的标准方式在谷歌开发者指南建议,也不知怎么使用Maven管理一些罐子依赖。不建议这样做,你应该使用谷歌完全标准的方式(因为R17库/文件夹)或完全mavenize您的Andr​​oid项目的依赖管理。

According to the screenshot you attached, it looks like you setup (or import) your Android project in Eclipse by the standard way google suggest in dev guide, but also somehow use Maven manage some of jar dependencies. This is not recommended, you should use either purely google standard way (libs/ folder since r17) or completely mavenize your android project for Dependency management.

这篇关于我得到一个java.lang.NoClassDefFoundError的上课的时候​​显然是有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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