android 报错之noclassdeffounderror

解决方案1:

导入第3方jar包问题,明明导入了jar但还是报java.lang.NoClassDefFoundError
解决步骤:
1、在Android项目根目录下新建一个lib文件夹;
2、把你需要导入的第3方jar包复制到lib文件夹中;
3、在lib文件夹上点右键,选Bulid

path –> Use as source

folder。
如果只是单纯的引入jar,在Eclipse中编译是可以通过,不会有错误,但在设备上运行的时候还是会报java.lang.NoClassDefFoundError的错误。所有上面的3步很关键!

2:
 右键工程,
  Build path,

  java build path,选择libraries

  在右边的按钮中点击“Add Library”
  选择“User library”,点击“下一步”
  点击“User librarys”按钮
  在出现的界面中点击“New..”按钮
  在弹出的界面中随便起一个名字,点击“确定”
  点击“Add jars”按钮选择第三方jar包,点击“确定”完成操作。

需要添加这么一个操作。在 Library旁边有个Order and Export
要将你刚刚添加的lib置为top

时间: 2024-08-28 17:02:42

android 报错之noclassdeffounderror的相关文章

cocos2dx在windows下搭建环境android报错

报错:Program bash is not found in PATH (如果按照我的方法来的话是没有这个错误的,我之前用别的方法的时候有但是后来还是没解决,写出来放到这里做参考吧) 参考原文:http://blog.csdn.net/fuyongbing1986/article/details/11556149 方法: 1.把cygwin/bin加入系统环境变量Path下 2.右击工程-->properties-->C/C++ Build -->ToolChain Edit    确

cordova platform add android报错问题处理

第一次在博客园写博客,有错误的还请大神不要喷,互相学习么,我也是正在学习中,这是我遇到的问题及解决的办法. cordova platform add android 报错内容大致是匹配不到cordova-android版本,在百度上查的资料说是android sdk环境没配置成功,于是我执行android -h 发现报错:"找不到路径". 于是在晚上又百度,说是在环境变量path里面添加%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Sy

Android报错

1. Starting emulator for AVD 'new' emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable. CPU acceleration status: HAX kernel module is not installed! 发生情景: 创建 Android 模拟器,模

Android报错:WindowManager$BadTokenException: Unable to add window -- window has already been added

很久之前测试通过的代码,现在手机升级了Android7.0后一运行就崩溃,报出这样的错误,具体错误如下: Process: com.example.sho.android_anti_theft, PID: 26807 android.view.WindowManager$BadTokenException: Unable to add window -- window [email protected] has already been added at android.view.ViewRoo

cocos run -p android 报错:文件名、目录名卷标语法不正确

我的项目是cocos2d-x-3.7.1的项目,用命令行(cocos run -p android)打包的时候报错: running: '"D:\develop\adt-bundle-windows-x86-20140321\apache-ant-1.9.3\bin\ant"clean debug -f D:\deveop\Test\proj.android\build.xml -Dsdk.dir="D:\develop\adt-bundle-windows-x86-2014

Android报错:The content of the adapter has changed...与Channel is unrecoverably broken and will be disposed的分析与解决办法

在Android中adapter错误: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. 分析: 这个错误通常是listview等控件在使用adapter适配数据时

ionic真机调试Android报错 - could not read ok from ADB Server * failed to start daemon * error: cannot connect to daemon

在使用真机调试Android程序时,报错如下: could not read ok from ADB Server * failed to start daemon error: cannot connect to daemon 首先,打开命令行工具,找出占用5037端口号的对应pid号 netstat -ano | findstr :5037 如果端口被占用,在任务列表中找到占用端口的进程 tasklist | findstr processID 打开任务管理器,将对应pid号的进程杀死.然后

ionic cordova build android 报错 解决

执行 ionic cordova build android 时遇到报错,build时需要安装一些依赖的,所以首先必须联网,另外,这遇到这个错误时npm registry用的是taobao的镜像:https://registry.npm.taobao.org/, 然后我改为了cnpm镜像 :http://r.cnpmjs.org/,再次执行ionic cordova build android成功了.推荐安装nrm,用nrm来进行npm registry的管理,简单方便. 原文地址:https:

ionic2踩坑之ionic build android报错

自己项目一直跑的好好好好的,build还是run都没问题,今天忽然一个小伙伴build一直报错.\ 错误如下: Error occurred during initialization of VMCould not reserve enough space for 2097152KB object heap 第一反应是java虚拟机内存不够,然后按网上的新建环境变量 变量名:_JAVA_OPTIONS 变量值:-Xmx512M 然并卵,问题并没有得到解决,最后在一个国外网站上找到了问题原因. 原