eclipse开发安卓项目的一些小错误(1)

时间:2021-09-02 11:49:08

1. 显示已经成功安装到模拟器上但是模拟器没有显示,出现no launcher activity found,原因: 

AndroidManifest.xml里面没有配置启动项(原因多种多样),在<application></application>中少了这段代码

 

<activity android:name=".MainActivity" android:label="@string/app_name">

<intent-filter>

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>

</activity>


2.项目的main.xml出现

No resource found that matches the given name (at 'title' with value '@string/action_settings')

解决方法:一般在 string.xml文件中加上<string name="action_settings">something here</string>
3.R文件不见了或者clean之后不见了首先要检查一下是不是某些布局文件写错了 检查无误后在右键项目-Android-tool-fix project.properties即可。
4.导入项目后发现Unable to resolve target 'android-17',查看自己的sdk版本号,在sdk里面的about有写,然后用记事本打开project.properties,修改最后一行的版本号,之后fix project.properties 关闭,重开即可。

5.打开eclipse后发现报告错误 device.xml 下的d:skin无效,方法是把有问题的 devices.xml 文件删除,再把 sdk 里面 tools\lib 下的这个文件拷贝到你删除的那个文件夹里,重启 eclipse 就 OK。