练笔过程中的error及solution汇总

本文汇总了Android开发过程中常见的错误及其解决方案,包括工程构建问题、资源引用错误、模拟器使用技巧等,帮助开发者快速定位并解决问题。

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:

就可以使用了。

 

6.

模拟器按右Ctrl + F11不横屏,坐Ctrl才可以。

adb install <path>

 

7.    urlText = (EditText)findViewById(R.id.url_field);

Error:

R.id cannot be resolved

Solution:

android:id = "@+id/url_field" //中间不可以存在空格

转载于:https://www.cnblogs.com/topcoderliu/archive/2010/08/10/1796838.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值