1 、android工程中引入第三方JAR包后安装APK时提示错误:java.lang.NoClassDeFoundError
右击工程-->Build path-->java build path, 选择libraries-->Add Library-->User library, 点击“下一步”,点击“User librarys”按钮
在出现的界面中点击“New..”按钮,在弹出的界面中随便起一个名字,点击“确定”
点击“Add jars”按钮选择第三方jar包,点击“确定”完成。
后面的步骤很重要,如果不进行后面的操作。在Eclipse里显示编译通过,不会有错误,但在模拟器或真机上运行的时候可能就会出现java.lang.noclassdeffounderror之类的错误:
1)在Android项目根目录下新建一个libs文件夹;
2)把你需要的导入的第三方Jar包复制进这个目录;
3)在libs目录上点右键,选Bulid path –> Use as source folder
2、Unable to execute dex: Java heap space解决方案
参考:http://hi.baidu.com/wudaovip/blog/item/a0f0ba26ea41d4018b82a14a.html
1)eclipse.ini to this: -Xms128m -Xmx512m
or something higher, but this didn’t work for me. After modify the eclipse.ini, I cannot start the eclipse. By StackOverflow, I find a solution:
eclipse.ini file must have -vm on first line and path on second line. don’t try to put everything into one line!
2)-vm C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe
After add the -vm and the path in my eclipse.ini, I can start my Eclipse and the problem has been resolved.
3)Another way to solve the ” Conversion to Dalvik format failed: Unable to execute dex: null”
problem is using the user library, the concrete steps are as follows:
1. Right-click the project in Eclipse and select “Build Path -> Add Libraries…”.
2. Select User Library from the list and click Next.
3. Click the “User Libraries…” button.
4. Click “New…” in the User Libraries dialog.
5. Give the user library a name and select the System library checkbox and click OK.
6. Highlight the newly added user library in the list and click the “Add JARs…” button and add the desired jar files.
7. Click OK on the User Libraries dialog. 8. Make sure the new user library is checked in the Add Library dialog a nd … Posted by CuteAndroid 。
我的错误用第一种方法解决了,只是把数值改得更大一些。
3、Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
1)启动模拟器时,:-partition-size 120 表示內存大小为120M(Eclipse中在项目Target的Options中添加。)
2)卸载已经安装的应用,重新安装。(我用的这种方式)
4、Installation error: INSTALL_FAILED_INSUFFICIENT_DEXOPT
1)Starting emulator once again from the Android SDK and AVD Manager
bye selecting the optionWipe User Data
has removed this problem for me.
You can find the option as highlighted in the below given image:(http://stackoverflow.com/questions/5153515/how-to-solve-install-failed-dexopt-this-error)
5、Conversion to Dalvik format failed with error 1
库之间有冲突,根据LOG信息找到重复加载的库或是别的文件,删掉。
clean工程是个好方法