Android开发遇到的错误(内容包括转发别人的)

1 报错信息:android.content.res.Resources$NotFoundException: String resource ID #0xf0

原因:给EditText设置setText()时,传入了一个int值

2 在android项目中,通过run as java application运行java类时,报错:

Invalid layout of java.lang.String at value
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (javaClasses.cpp:129), pid=8552, tid=9696
#  fatal error: Invalid layout of preloaded class
#
# JRE version: 7.0_17-b02
# Java VM: Java HotSpot(TM) Client VM (23.7-b01 mixed mode windows-x86 )
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

解决办法:

·选中该类,右键Properties

·选择Run/Debug Settings

·在右面列表中双击该类

··选择Casspath页签,将Bootstrap下面清空


3 导入项目时报错:gen already exists but is not a source folder. Convert to a source folder or rename it.

原因:项目组中的.classpath文件,eclipse不能识别导入项目的src代码文件夹,需要重新指明源码所在的文件夹,在build path的source页签中指明

猜你喜欢

转载自blog.csdn.net/wsdhla/article/details/38036367