NoClassDefFoundError的 - 的Eclipse和Android [英] NoClassDefFoundError - Eclipse and Android

查看:124
本文介绍了NoClassDefFoundError的 - 的Eclipse和Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,试图运行Android应用程序当中,直到添加第二个外部库的构建路径,是工作的罚款。由于已经添加了scoreninja罐子,我现在得到的的NoClassDefFoundError 当我尝试运行应用程序。

I'm having a problem trying to run an Android app which, up until adding a second external library to its build path, was working fine. Since having added the scoreninja jar, I now get a NoClassDefFoundError when I try to run the app.

下面的消息:

02-11 21:45:26.154: ERROR/AndroidRuntime(3654): java.lang.NoClassDefFoundError: com.scoreninja.adapter.ScoreNinjaAdapter

由于所有的构建脚本是由Android的工具(?)产生的,我不知道还有什么我可以做的比清理和重建或重新启动Eclipse的其他(我已经尝试了所有三个)。有谁知道我怎么能修改吗?

As all of the build scripts are generated by the Android tools (?), I'm not sure what else I can do other than cleaning and rebuilding or restarting eclipse (I have already tried all three). Does anyone know how I can amend this?

推荐答案

我更新ADT后有这个问题。

I had this problem after updating ADT.

我存储我所有的JAR文件名为LIB文件夹中,并添加罐子到构建路径正常的Ec​​lipse的方式。这工作正常,直到我的更新。

I was storing all of my JAR files in a folder called "lib" and adding the jars to the build path the normal Eclipse way. This worked fine until my update.

我更新后,我得到了NoClassDefFoundError的,我可以清楚地看到被列入罐类(检查出的ReferencedLibraries类)。

After my update, I was getting the NoClassDefFoundError for a class that I could clearly see was included in the jar (checking out the ReferencedLibraries classes).

解决的办法是从构建路径中删除我的罐子并重新命名我的lib目录文件夹,库。这是一种蚂蚁惯例,并且似乎是新的ADT发现,并包括在一个文件中的apk库的方式。一旦我这样做,一切正常。

The solution was to remove my jars from the build path and rename my "lib" folder to "libs". This is an ant convention, and seems to be the way the new ADT finds and includes libraries in an .apk file. Once I did this, everything worked fine.

这篇关于NoClassDefFoundError的 - 的Eclipse和Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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