ANDROID程序员开发总结(保证有用)_第1页
ANDROID程序员开发总结(保证有用)_第2页
ANDROID程序员开发总结(保证有用)_第3页
ANDROID程序员开发总结(保证有用)_第4页
ANDROID程序员开发总结(保证有用)_第5页
已阅读5页,还剩25页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、ANDROID程序员开发总结【错误信息】2011-01-19 16:39:10 - ApiDemos WARNING: Application does not specify an API level requirement!2011-01-19 16:39:10 - ApiDemos Device API version is 8 (Android 2.2)原因:不影响正常运行。在AndroidManifest.xml文件中没有加API的版本号,在<manifest> </manifest> 之间加<uses-sdk android:minSdkVersion

2、="3"></uses-sdk>2011-01-19 16:55:04 - ApiDemos Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE2011-01-19 16:55:04 - ApiDemos Please check logcat output for more details.2011-01-19 16:55:05 - ApiDemos Launch canceled!该设备没有足够的存储空间来安装应用程序, 【错误信息】2011-02-18 11:46:53 Faile

3、d to push selection: Is a directory原因:原先目录已经有pkg_3.apk的文件夹,再copy一个pkg_3.apk安装文件时出现问题,解决办法,先删除掉pkg_3.apk的文件夹2011-03-04 09:25:12 - ActivityMain: DxUNEXPECTED TOP-LEVEL EXCEPTION:java.lang.IllegalArgumentException: already added: Lorg1/apache/commons/codec/net/RFC1522Codec;2011-03-04 09:25:12 - Activit

4、yMain: Dx at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)2011-03-04 09:25:12 - ActivityMain: Dx at com.android.dx.dex.file.DexFile.add(DexFile.java:143).2011-03-04 09:25:12 - ActivityMain: Dx1 error; aborting2011-03-04 09:25:12 - ActivityMain Conversion to Dalvik

5、 format failed with error 1原因: 【错误信息】启动Eclipse时出现: this android sdk requires android developer toolkit version 10.0.0 or above.current version is 8.0.1.v201012062107-82219.please update adt to the latest version原因:Eclipse的android开发插件版本过低,应该下载ADT-10.0.0,并且1. 启动 Eclipse, 然后进入 Help > Insta

6、ll New Software.2. 在 Available Software 对话框里,点击 Add. 【错误信息】2011-03-09 15:21:34 - Info Failed to install Info.apk on device '?': Unable to open sync connection!2011-03-09 15:21:34 - Info java.io.IOException: Unable to open sync connection!2011-03-09 15:21:34 - Info Launch canceled!原因:关闭模

7、拟器和eclipse,执行adb kill-server命令,然后重试一下 【错误信息】调用Webservice时出现.SocketException: Permission denied (maybe missing INTERNET permission)原因: 需要访问到网络,所以,在AndroidManifest.xml中,需要进行如下配置: <uses-permission android:name="android.permission.INTERNET" /> 【错误信息】org.xmlpull.v1.XmlPullP

8、arserException: expected: START_TAG /soap/envelope/Envelope (position:START_TAG </wsdl/wsdl:definitions targetNamespace=''>2:603 injava.io.InputStreamReader44a3a7b0)原因有可能是以下2个之一:1)Webservice服务器的Soap版本为1.0,所以客户端指定SoapSerializationEnvelop

9、e envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);VER11改为VER102)String serviceUrl = "1:10000/nqbx/service/InqBxWebService?wsdl"Url指的是你的webservice的地址.一般都是以*.wsdl或者*.?wsdl结束的.但是.需要注意的是.要去掉后面的.wsdl或者.?wsdl 【错误信息】 在新的线程中 public class HttpThread ex

10、tends Thread .增加一个弹出窗体:java view plaincopyprint?1. new AlertDialog.Builder(this).setTitle("数据加载失败").setMessage("请检查网络连接情况")           .setPositiveButton("OK", new DialogInterface.OnClickListener()

11、0;           public void onClick(DialogInterface dialoginterface, int i)                        

12、0;           ).show();         原因及解决办法:/不能在线程中操作UI界面java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() 修改后:java view plaincopyprint?1. new

13、0;AlertDialog.Builder(query.chuanbo_detail.this).setTitle("数据加载失败").setMessage("请检查网络连接情况")           .setPositiveButton("OK", new DialogInterface.OnClickListener()    

14、        public void onClick(DialogInterface dialoginterface, int i)                           【错误信息】

15、The constructor AlertDialog.Builder(chuanbo_detail.HttpThread) is undefined 原因及解决办法:在UI主线程之外是无法对UI组件进行控制的。因为你必须在新线程任务完成之后利用各种方法先UI主线程发送消息通知任务完成从而来显示各种提示消息。线程间通信方法有多种,常用的是用handler来传递消息。如下:线程中构造消息:  java view plaincopyprint?1. /构造消息Message message = handle.obtainMessage();Bundle

16、60;b = new Bundle();b.putString("tag", "1");message.setData(b);handle.sendMessage(message);  另外自定义消息:c-sharp view plaincopyprint?1. /* * 捕获消息队列 fubin.pan 2011-04-02 */Handler handler = new Handler() p

17、ublic void handleMessage(Message m) if (!m.getData().getString("tag").equals("1")                            .elsen

18、ew AlertDialog.Builder(chuanbo_detail.this).setTitle("数据加载失败").setMessage("请检查网络连接情况!")         .setPositiveButton("OK", new DialogInterface.OnClickListener()        

19、0;    public void onClick(DialogInterface dialoginterface, int i)                               

20、0;      ).show();    【错误信息】 android低版本工程(如1.5)放到高版本环境中(如2.2)可能会上述错误,解决方法如下:1。 如果不修改android sdk版本,则使用project clean 命令作用于某工程即可。       (该处理方式只是在高版本中兼容了低版本工程,未真正意义上的升级)2。 如果修改android sdk版本,则需要以下几个步骤:   &#

21、160;   1)修改SDK             选择工程,build path -> configure build path -> library 删除引用的低版本SDK,             然后add External JARs,选择高版本SDK,OK,保存    

22、60;   2)修改classpath文件              该文件可能存在该项: <classpathentry kind="lib"   path ="你所指定的高版本的地址"             把她修改成<classpathentry kind=&

23、quot;con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK" />        3) 修改AndroidManifest.xml             在AndroidManifest.xml文件中,application标签后添加<uses-sdk android:minSdkVersion=&q

24、uot;3"></uses-sdk>        4) 修改perties(很重要)              该文件最后一行(前面没用#的)target=android-3 该成target=android-8,保存。        再看看你的工程和新建的android 2.

25、2的工程结构就一样了。 【错误信息】在线程debug(运行没有问题)时调用Webservice时出现:'JDI thread evaluations' has encountered a problemException processing async thread queue Exception processing async thread queueJDI thread evaluations 原因及解决办法:与运行无关的错误,关掉'expressions'视图就可以了 【错误信息】打开开源项目JavaEye An

26、droid client时出错http:/javaeye-android-这是 JavaEye 网站基于 Android 平台的客户端软件,可用以阅读动静、帖子、闲谈, 收躲, RSS 等功用。 2011-04-19 10:55:11 - JavaEye Android Client Project has no perties file! Edit the project properties to set one.原因及解决办法:遇到这种情况,可以创建一个perties文件,如果创建之后还是有错误,那么delete这个project,重

27、新import。编辑perties 之后,一般会自动创建 gen 目录, 如果没有,也可尝试手工创建。 Adroid Adapter ADB Interface 严重错误今天在配置完Eclipse和Android SDK开发环境之后,想用华为C8500手机通过USB连接电脑,并在手机上去调试,但莫名其妙出现Adroid Adapter ADB Interface 安装严重错误,在豌豆荚手机精灵安装驱动的时候,也出现这个错误,后面也莫名奇妙的多装几次就好了,还没找到什么原因。【错误信息】用手机调试运行出现:ActivityManager: Warning: Act

28、ivity not started, its current task has been brought to the front原因及解决办法:该手机已经启动了相同名字的应用,关闭之后再试! 【错误信息】最近(2012-04-05)在打开SDK Manager.exe,更新SDK时,会出现如下错误:Failed to fetch URL https:/dl- reason: Connection timed out: connect原因及解决办法:dl-在大陆封掉了解决方法就是修改C:WindowsSystem32driversetchosts文件。添加一行:html view p

29、laincopyprint?1.        dl-   dl-保存,重新启动SDK Manager.exe 【错误信息】2012-04-08 17:42:24 - JavaEye Android Client -2012-04-08 17:42:24 - JavaEye Android Client Android Launch!2012-04-08 17:42:24 - JavaEye Android Client The connectio

30、n to adb is down, and a severe error has occured.2012-04-08 17:42:24 - JavaEye Android Client You must restart adb and Eclipse.2012-04-08 17:42:24 - JavaEye Android Client Please ensure that adb is correctly located at 'C:androidandroid-sdk-windowsplatform-toolsadb.exe' and can be executed.原

31、因及解决办法:查看任务管理器,关闭所有adb.exe重启eclipse即可 【错误信息】更新SDK时错误信息:Site AuthenticationPlease login to the following .原因及解决办法:Cancel跳过提示 【错误信息】打开Eclipse 提示安装ADT 17 原因及解决办法:最新的Android SDK只能安装ADT 17.0.0可用的下载地址:这里可不能用常规方法安装这个 ADT 17.0.0.zip 文件, 首先得解压这个文件,将里面的文件夹覆盖掉Eclipse安装目录下的文件夹。然后再用Help->

32、install new software->Add -> Name: ADT   Archive:选择ADT 17.0.0.zip  【错误信息】安装ADT 17.0.0时,提示:Your original request has been modified.  "Android DDMS" is already installed, so an update will be performed instead.  "Android Development Tools" is already

33、installed, so an update will be performed instead.  "Android Hierarchy Viewer" is already installed, so an update will be performed instead.  "Android Traceview" is already installed, so an update will be performed instead.Cannot complete the install because one or more

34、 required items could not be found.  Software being installed: Android Development Tools 17.0.0.v201203161636-291853 (com.android.ide.eclipse.adt.feature.group 17.0.0.v201203161636-291853)  Missing requirement: Android Development Tools 17.0.0.v201203161636-291853 (com.android.ide.eclipse.

35、adt.feature.group 17.0.0.v201203161636-291853) requires 'org.eclipse.core.runtime 3.6.0' but it could not be found原因及解决办法:requires 'org.eclipse.core.runtime 3.6.0' but it could not be foundeclipse需要升级到3.6.0,我的版本是3.5.2【错误信息】Updates ADT 17.0.0时提示:Cannot complete the install becaus

36、e one or more required items could not be found.  Software being installed: Android Development Tools 17.0.0.v201203161636-291853 (com.android.ide.eclipse.adt.feature.group 17.0.0.v201203161636-291853)  Missing requirement: Android Development Tools 17.0.0.v201203161636-291853 (com.android

37、.ide.eclipse.adt.feature.group 17.0.0.v201203161636-291853) requires 'org.eclipse.core.runtime 3.6.0' but it could not be found原因及解决办法:requires 'org.eclipse.core.runtime 3.6.0' but it could not be foundrequires 'org.eclipse.ui 3.6.0' but it could not be foundeclipse需要升级到3.6.0

38、,我的版本是3.5.2 【错误信息】 2012-04-09 17:14:49 - Info -2012-04-09 17:14:49 - Info Android Launch!2012-04-09 17:14:49 - Info Connection with adb was interrupted.2012-04-09 17:14:49 - Info 0 attempts have been made to reconnect.2012-04-09 17:14:49 - Info You may want to manually restart adb from the

39、 Devices view.原因及解决办法:重新启动eclipse 【错误信息】2012-04-10 09:45:49 - adb ADB server didn't ACK2012-04-10 09:45:49 - adb * failed to start daemon *原因及解决办法:查看任务管理器,关闭所有adb.exe 重启eclipse 【错误信息】2012-04-10 09:53:50 - ApiDemos -2012-04-10 09:53:50 - ApiDemos Android Launch!2012-04-10 09:53:50 - Api

40、Demos The connection to adb is down, and a severe error has occured.2012-04-10 09:53:50 - ApiDemos You must restart adb and Eclipse.2012-04-10 09:53:50 - ApiDemos Please ensure that adb is correctly located at 'C:androidandroid-sdk-windowsplatform-toolsadb.exe' and can be executed.原因及解决办法:&#

41、160;重启eclipse 【错误信息】安装android sdk时: -= warning! =- A folder failed to be renamed or moved. On Windows this typically means that a program Is using that Folder (for example Windows Explorer or your anti-virus software.) Please momentarily deactivate your anti-virus software. Please also clo

42、se any running programs that may be accessing the directory 'C:androidandroid-sdk-windows/android-sdk-windows/too!s'. When ready, press YES to try again.原因及解决办法:1, 复制 tools目录为一个新的目录 tools-copy ,此时在android-sdk-windows 目录下有两个目录 tools 和 tools-copy2, 在tools-copy目录以管理员身份运行 android.bat ,这样就可以正常 up

43、date all 了3.重新运行SDK Manager.exe.问题解决! 【错误信息】“正在启动JavaEyeApiAccessor“遇到问题。不能连接至VM原因及解决办法:连接不到手机虚拟机重启拔插手机连接线 【错误信息】调试的时候: 2012-04-13 17:46:27 - IpsosAutoAndroid Failed to install IpsosAutoAndroid.apk on device '?': timeout2012-04-13 17:46:27 - IpsosAutoAndroid Launch canceled!原因

44、及解决办法:连接真机调试的时候如果连接太久没响应就会出现timeout1.在window-prensent.-android-设置ddms的timeout时间。这种是就最有效、最简洁的。2.delete android里面的 apk,保证速度。不过试过一次后,真机好像变“聪明了”,也出现timeout。3.Cleaning the project (Project->Clean),不行就重启eclipse或者android,很郁闷的是,重启后运行第一次可以。第二次就开始变慢了,也就是出现timeout4.关闭eclipse ,然后再重启,就ok 【错误信息】调用org.ksoa

45、p2.*访问webservice时04-13 10:09:49.565: E/dalvikvm(354): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method.04-13 10:09:49.585: E/dalvikvm(354): Could not find class 'org.ksoap2.transport.HttpTransportSE', referenced from method.【错误信息】Unable to open stack

46、 trace file '/data/anr/traces.txt': Permission denied原因及解决办法:Unable to open stack trace file '/data/anr/traces.txt': Permission 多见于这个Activity你没有在AndroidManifest.xml中注册,就会报这样的错误。 【错误信息】source not found找不到源原因及解决办法:android目录下没有对应的sources文件 如下图,不知道为什么,最新的SDK更新API 14/15中有Sources

47、 for Android SDK,而之前的版本的源码就不更新,气愤!下载对应的SDK Sources后,放到android-sdk-windowssources 目录下就OK了! 【错误信息】Android使用KSOAP2调用WebService时: java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject原因及解决办法:虽然标明上 Java Build Path->Libraries中已经引用了ksoap2-android 包,但是需要order and export中也把该包勾选上

48、60;【错误信息】error: Error: No resource found that matches the given name (at 'layout_toLeftOf' with value'id/top_send_btn'). header_questionitemlist.xml /IpsosAutoAndroid/res/layout 第 27 行 Android AAPT Problem原因及解决办法:  【错误信息】无法解析导入 com.renren.api.connect.and

49、roid.R原因及解决办法:导入android源码有错,R.java文件不能自动生成解决方法 【错误信息】Eclipse中的DDMS无法打开data文件夹下的内容,也不能往里面写东西原因及解决办法:通过软件获取ROOT权限 【错误信息】Fri May 04 16:27:46 CST 2012Internal error logged from JDI Debug: org.eclipse.jdi.TimeoutException: 等待包 8 时发生超时。 at ernal.connect.PacketReceiveManag

50、er.getReply(PacketReceiveManager.java:171) at ernal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:180) .原因及解决办法: 重新启动eclipse,不行的话重启机器 【错误信息】java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()

51、原因及解决办法: 如下是有问题的代码: java view plaincopyprint?1. Thread t = new Thread()   2.     Override  3.     public void run()   4.         super.run()

52、;  5.         try   6.   7.             QuestionItemlist = quesHandler.getData();  8.           

53、;  if (QuestionItemlist.size() = 0)   9.                 Toast.makeText(questionitemlist2.this,"问卷题目为空",Toast.LENGTH_LONG).show();  10.     

54、         else   11.                 Toast.makeText(questionitemlist2.this,"问卷题目已经获取",Toast.LENGTH_LONG).show();  12.     

55、;          13.          catch (Exception e)   14.             e.printStackTrace();  15.    

56、0;      16.       17. ;  18. t.start();  Thread t = new Thread() Overridepublic void run() super.run();try QuestionItemlist = quesHandler.getData();if (QuestionItemlist.size() = 0) Toast.makeText(questionitemlist2.this,&

57、quot;问卷题目为空",Toast.LENGTH_LONG).show(); else Toast.makeText(questionitemlist2.this,"问卷题目已经获取",Toast.LENGTH_LONG).show(); catch (Exception e) e.printStackTrace();t.start();【错误信息】java.lang.IllegalArgumentException: The key must be an application-specific resource id.原因及解决办法:java view pl

58、aincopyprint?1. mRadioButton.setTag(1,sQuestionItem.get(i).getToNext();/设置监听  ToNext:下一题目   2. mRadioButton.setTag(2,sQuestionItem.get(i).getToEnd();/设置监听  ToEnd:是否终止  mRadioButton.setTag(1,sQuestionItem.get(i).getToNext();/设置监听 ToNext:下一题目mRadioButton.setTag(

59、2,sQuestionItem.get(i).getToEnd();/设置监听 ToEnd:是否终止抛出IllegalArgumentException的原因就在于key不唯一,正确代码如下:java view plaincopyprint?1. mRadioButton.setTag(R.id.tag_tonext,sQuestionItem.get(i).getToNext();/设置监听  ToNext:下一题目   2. mRadioButton.setTag(R.id.tag_toend,sQuestionItem.get(i).getToEn

60、d();/设置监听  ToEnd:是否终止  mRadioButton.setTag(R.id.tag_tonext,sQuestionItem.get(i).getToNext();/设置监听 ToNext:下一题目mRadioButton.setTag(R.id.tag_toend,sQuestionItem.get(i).getToEnd();/设置监听 ToEnd:是否终止【错误信息】点击Debug 运行 结果模拟器总是会弹出Waiting for Debugger 然后程序又可以正常运行如果你想调试的时候去掉 Waiting for Debug

61、ger 提示原因及解决办法:重启启动平板电脑机器就OK 【错误信息】拔掉连接线,运行程序还出现如下问题:android Debuger 出现:"Waiting for Debugger - Application XXX is waiting for the debugger to Attach"然后关闭原因及解决办法:重启机器或者重启下adb 【错误信息】AndroidManifest.xml配置中加入android:installLocation="auto"出现错误:error: No resource identifier f

62、ound for attribute 'installLocation' in package 'android'原因及解决办法:开发包需要Android2.2以上Change the build target by editing the project properties (right-click on the project in Eclipse), and choose a target with at least API Level 8 【错误信息】2012-08-22 17:21:53 - IpsosAutoAndroid Project

63、 has no perties file! Edit the project properties to set one.2012-08-22 17:22:16 - IpsosAutoAndroid Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.原因及解决办法:Project / Properties / Java Compiler  ,

64、查看Compiler compliance level 指定的版本号被指定为1.6,并且Enable project specific seetings 被勾选。 【错误信息】Android Tools->Export Signed Application Package出错Export aborted becase fatal lint errors were found.These are listed in the Problems view. Either fix these before running Export again, or turn off "

65、Run full error check when exporting app" in the Android > Link Error Checking preference page原因及解决办法:可能是程序中缺少资源文件之类的下图点击window->preferences如下图点击android下面的lint error checking ->勾选掉run full error .如下图【错误信息】Android 签名打包时出现下面错误:2012-09-09 00:15:34 - IpsosAutoAndroid Proguard returned with error code 1. See console2012-09-09 00:15:34 - IpsosAutoAndroid Note: there were 4 duplicate class

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论