Eclipse中开发Android应用出现的error及solution汇总
1.
Error:
project cannot be built until build path errors are resolved
Cause:
没有在工程里引入android开发包
Solution:
右击选择build path ,Add library
2.
Error:
r.layout.main cannnot be resolved
Cause:
默认新建project中 import android.R;
Solution:
注解掉 (//import android.R;)
Context:
Having the import android.R seems to refer to the default R.java provided by the android platform instead of the version for your application…. hence the main.xml being referred to is not found. Removing the import statement fixes the problem by causing the application to search for R.java locally.
3.
Error:
R cannot be resolved
Solution:
关掉build automatically,重新clean(貌似还有其他东西,忘掉了) O_O
4.
Error:
在res/draw文件夹里添加了mp3文件,在R文件里没有自动添加
Solution:
没有自动build,勾选即可
5.
Error:
adb 不是内如或者外部命令,也不是可运行的程序或批处理文件。
Solution:
启动模拟器,
cd到tools文件夹目录,
然后在d:
就可以使用了。