我们在进行安卓的开发时候会有一些报错,那么来看看Android开发常见报错,Android Project时报的错解决办法,希望对你有帮助,本教程总结于谷歌,百度等搜索平台。
一、常见错误:新建Android Project时报的错
种:Description Resource Path Location Type
Project ‘aa’ is missing required source folder: ‘gen’ aa Build path Build Path Problem
第二种:MySecondPhoneAndroid] Error in an XML file: aborting build.
I have fixed it very simple:
Right click project ‘xxx’ ->Properties ->Java Build Path ->Tab ‘Order and Export’->Select ‘xxx/gen’ ->Click ‘Up’
then ‘OK’, the problem is OK now.
二、没找到run configurations 怎么办?
三、怎么导入Android:
看网上流传的Eclipse导入的方法都是在新建Android程序时使用“Create project form existing source”选项实现的导入,虽然也能实现,但感觉很山寨的样子,而且导入的还在原位,Eclipse不会自动将其复制到workspace目录,且如果预先将复制到workspace目录再导入的话会报错,提示这里已经有一个同名了。佳的导入方法应该是先复制目录到workspace目录中,再执行以下操作:
四、
Android开发问题:打开strings.xml不停地报错 |
在刚安装好Eclipse以及ADT插件,准备开发Android的朋友可能会遇到这样的问题:在android中,打开或者编辑strings.xml都会不停的报错:java.lang.nullpointerexception。
我也遇到过这种情况,在网上搜索了一些信息,在一个论坛上看到说是Eclipse的bug,解决方法为:点击Window菜单/选择Preferences选项/进入页面后点开XML/然后点开XML Files/点击Editor选项/把其中的“Use inferred grammar in absence of DTD/Schema”选项给勾掉,然后重新启动Eclipse行了。
五、
有时候在新创建的android或者导入进来的的时候会出现Android requires .class compatibility set to 5.0. Please fix project properties.这个错误.大概的意思是因为android的版本不一致导致的吧.因为我导进来的是android sdk1.5 而我的avd的版本是2.0 ,所以出现了这个问题.
具体的解决方法如下:
1: 选择 project -> Android Tools ->Fix Project Properties.
重新 clean project
2:如果上面不管用,只能使用暴力一点的方法,复制源代码到新的目录. 包括AndroidManifest.xml, src/, assets/, res/. 选择 File-> New-> Android Project -> Contents -> Create project from existing source -> <your new location>
六、
http://stackoverflow.com/questions/938719/android-using-locationmanager-does-not-give-a-geo-fix
七、
点击中的方法刷新几次OK了