编译错误:
1. 无法访问的语句
是由于有一段代码,不论任何情况,始终不能走到,因为编译时会报此错误。
2. make: warning: Clock skew detected. Your build may be incomplete.
这个错误是由于系统时间比文件修改时间早造成的(及编译时的时间早于文件创建的时间,这一般是由于系统时间错误导致的),一般可以通过修改系统时间
来消除错误:
date 命令查看当前系统时间
date -s 5/18/2011 命令可以修改系统日期
date -s 16:10:59 命令可以修改系统时间
总之保证系统时间比文件修改时间迟或新,那么上面的编译警告就不存在了。
3. 编译android4.4 报错error: call to '__property_get_too_small_error' declared with attribute error: property_get() called with
too small of a bufferIn function 'property_get'
找到调用property_get的地方 将中间一个数组参数的定义改一下:
value[PROPERTY_VALUE_MAX];
property_get("persist.xxx.xxxx",value,"0");
4. linux下编译时,出现该错误:
fatal error: error writing to /tmp/ccTAVuOl.s: No space left on device
主要是系统 /tmp/空间不足引起的,tmp文件夹空间不足了,不能满足编译的需求,编译的中间文件不能写入。
解决办法 mkdir 文件夹——你可以使用的文件夹 比如说 mkdir /mnt/kernelsrc/tmp
然后只要export TMPDIR=/mnt/kernelsrc/tmp
这样就不会出现 tmp文件夹不够用的情况。
或是删除一些没必要的文件,来扩大空间。
5
运行错误:
1. android.view.WindowManager$BadTokenException: Unable to add window
例如:
builder = new AlertDialog.Builder(this);
builder = new AlertDialog.Builder(this.getApplicationContext());
这里的this指的当然就是Acitivity.this , 指的是这个Acitivity的上下文,而this.getApplicationContext()指的则是整个应用的上下文。
一般由AlertDialog引起的。对于AlertDialog来说,是需要依赖一个View,而View是对应于Activity的。
AlertDialog是属于Acitivity的,当Activity销毁的时候它也必须销毁,不然就会出现这个错误。
2. android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@41cc2268 is not valid; is
your activity running?