简体   繁体   English

通过更新到最新的anddorid SDK和ADT,`AndEngine`示例没有在Eclipse上运行

[英]`AndEngine` Samples are not running on Eclipse by updating to Latest anddorid SDK and ADT

It was working fine but when i updated my eclipse to latest ADT and SDK it gave me this error. 它工作正常,但当我更新我的eclipse到最新的ADTSDK它给了我这个错误。

12-15 14:58:07.501: E/AndroidRuntime(639): java.lang.NoClassDefFoundError: org.andengine.AndEngine

If any one faced this before then please help me, because of this my AndEngine projects are also giving me the same error. 如果有人在此之前遇到这个,请帮助我,因为我的AndEngine项目也给了我同样的错误。

Thanks. 谢谢。

I have solved this issue by following these steps. 我已按照以下步骤解决了这个问题。

First I created new Library called AndEngineLibs and add all AndEngine supporting libraries to it. 首先,我创建了名为AndEngineLibs新库,并将所有AndEngine支持库添加到其中。

Then in the project properties->java build path->Order and Export is checked the AndEngineLibs 然后在项目属性 - > java build AndEngineLibs > Order和Export中检查AndEngineLibs

like shown. 如图所示。 I don't know it is related or not but it worked for me :) 我不知道它是否相关但它对我有用:) 在此输入图像描述

There are only three reasons you will ever get this error: 您将遇到此错误的原因只有三个:

  1. The class genuinely doesn't exist. 这堂课真的不存在。 If you are using code from an official example and getting this, make sure you have the latest build of the library 如果您使用的是官方示例中的代码并获得此代码,请确保您拥有该库的最新版本
  2. You have not added the jar to your build path. 您尚未将jar添加到构建路径中。 To fix this, right click on the jar in Eclipse, and do Build Path ► Add to Build Path. 要解决此问题,请右键单击Eclipse中的jar,然后执行BuildPath►Addto Build Path。
  3. Your jar is not in the /libs folder. 你的jar不在/libs文件夹中。 This happens when you have added the jar to the build path, but newer versions of ADT need it to be in /libs . 将jar添加到构建路径时会发生这种情况,但较新版本的ADT需要将它放在/libs Put it there and re-add it to the build path. 把它放在那里并重新添加到构建路径。

Mostly, such errors occur because newer versions of the ADT require all external jars to be in the libs folder. 大多数情况下,会出现此类错误,因为较新版本的ADT要求所有外部jar都位于libs文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM