Android : 新上手遇到的几个问题

来源:互联网 发布:成都万国数据怎么样 编辑:程序博客网 时间:2024/06/06 02:12

1.创建虚拟设备成功,但无法启动,出现如下错误

    ERROR: no search paths found in this AVD's configuration. Weird, the AVD's config.ini file is malformed. Try re-creating it.

 

 

解决方法:主要是avd的路径名中含有中文,默认是创建在c:/Users/我的用户名/.android下,要改变默认位置,创建名为ANDROID_SDK_HOME的环境变量,指向一个不含中文的位置即可

 

2. Error generating final archive: null 错误解决

 

配置好开发环境后,新建Android项目,提示如上错误,可以将debug.KEYSTORE删除或者手动新建一个新的

 

 

3.包名不正确

 

Android里包名要2个标识符,如com.leo,仅仅使用leo是不行的

 

4.hello world写在哪?

 

在新建的com.leo包中的文件继承了Activity类,先写在这里,若不写的话,输出的是res/values/string.xml里的内容,我的是Hello World, tttt!

 

 

 

下面是运行的效果

 

 

 

 

新手上路,有什么说的不对的欢迎拍砖。

 

有用的参考:

 

http://blog.csdn.net/tomey21/archive/2009/04/24/4107852.aspx

 

http://news.congci.com/news/windows7-android-eclipse-adt

 

http://bbs.ldci.com.cn/read.php?tid-59.html

 

http://farjumper.livejournal.com/5433.html

原创粉丝点击