Android的Eclipse的NoClassDefFoundError的外部.jar文件文件、Eclipse、Android、jar

由网友(相关游戏名字推荐>>)分享简介:我所遇到的一个奇怪的错误。我有一个使用外部库的Andr​​oid项目,具体为:I have come across a strange error. I have an Android project that uses external libraries, in particular:Android的支持,v4....

我所遇到的一个奇怪的错误。我有一个使用外部库的Andr​​oid项目,具体为:

I have come across a strange error. I have an Android project that uses external libraries, in particular:

Android的支持,v4.jar(在Android 1.6的片段支持) GoogleAdMobAdsSdk-4.3.1.jar(为广告)

该项目运行良好,直到我更新了插件的某些方面(不记得具体的我也没太在意它),之后,每当我尝试使用任何类从上面的.jar文件(或它的子类,甚至是那些由我定义的),我会得到一个java.lang.NoClassDefFoundError的。我找不到一番搜索之后的答案,所以我真的很为难。

The project ran fine until I updated some aspects of the plugin (can't recall the specifics as I did not pay too much attention to it) and after that, whenever I try to use any class from the above .jar files (or any of its subclasses, even ones defined by me), I would get a java.lang.NoClassDefFoundError. I could not find the answer after much searching, so I am really stumped.

我相信这个问题是关系到我的IDE是如何设置的,它没有什么实际code,所以我不会发布任何除非,如果它是绝对必要的。

I believe this problem is related to how my IDE is set up and it has little to do with actual code, so I will not post any unless if it's absolutely necessary.

推荐答案

您需要阅读这一点 - 在Android的依赖项目处理。

You need to read this - Dealing with dependencies in Android projects.

此环节也非常有用 - ClassDefNotFoundError与ADT 17

This link is also useful - ClassDefNotFoundError with ADT 17

基本上,创建名为库文件夹,然后把所有的中的文件。最近更新将自动完成剩下的为您服务。你并不需要编辑的路径了。

Basically, create a folder called libs and place all of your jar files inside. The recent update will automatically take care of the rest for you. You don't need to edit your path anymore.