android开发遇到的问题

时间:2023-03-09 15:29:09
android开发遇到的问题

1、虚拟机运行出下面的错Failed to allocate memory: 8

Failed to allocate memory: 8
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

解决:将虚拟器的内存设小一点android开发遇到的问题

2、真机调试时运行adb devices命令不到设备

adb.exe文件不在sdk的tooles目录下了,在sdk\platform-tools目录下,要将这个目录设在path环境变量里。

如果运行adb devices找不到设备,是手机驱动没有安装好,下载豌豆荚软件会帮安装手机驱动

3、SDK Manager更新不了内容

参考链接http://jingyan.baidu.com/article/fd8044fa834e905031137ac6.html

4、gen文件不能自动生成R.java代码

1)如果文件的目录太深,会出现这种问题,解决:将项目文件放到另一个不深的目录里,尽量不要有汉字。

2)gen文件是否是“只读”属性

5、莫名其妙的错误如:不能从Button转成TextView

解决:就gen里的R文件删除,重新生成。