自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Android開(kāi)發(fā)常見(jiàn)錯(cuò)誤匯總

移動(dòng)開(kāi)發(fā) Android
大家都在為項(xiàng)目開(kāi)發(fā)成功而喜悅,但可不知成功的路上是會(huì)經(jīng)常出錯(cuò)的,下面是我碰到的一些錯(cuò)誤集合,分享給大家,希望在以后的開(kāi)發(fā)中能夠避免錯(cuò)誤的再次出現(xiàn)。

【錯(cuò)誤信息】
[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)
原因:
不影響正常運(yùn)行。在AndroidManifest.xml文件中沒(méi)有加API的版本號(hào),在<manifest> </manifest> 之間加<uses-sdk android:minSdkVersion="3"></uses-sdk>
[2011-01-19 16:55:04 - ApiDemos] Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
[2011-01-19 16:55:04 - ApiDemos] Please check logcat output for more details.
[2011-01-19 16:55:05 - ApiDemos] Launch canceled!
該設(shè)備沒(méi)有足夠的存儲(chǔ)空間來(lái)安裝應(yīng)用程序,
【錯(cuò)誤信息】
[2011-02-18 11:46:53] Failed to push selection: Is a directory
原因:
原先目錄已經(jīng)有pkg_3.apk的文件夾,再copy一個(gè)pkg_3.apk安裝文件時(shí)出現(xiàn)問(wèn)題,解決辦法,先刪除掉pkg_3.apk的文件夾
[2011-03-04 09:25:12 - ActivityMain]: Dx
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lorg1/apache/commons/codec/net/RFC1522Codec;
[2011-03-04 09:25:12 - ActivityMain]: 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; aborting
[2011-03-04 09:25:12 - ActivityMain] Conversion to Dalvik format failed with error 1

原因:
【錯(cuò)誤信息】
啟動(dòng)Eclipse時(shí)出現(xiàn):
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開(kāi)發(fā)插件版本過(guò)低,應(yīng)該下載ADT-10.0.0,并且
1. 啟動(dòng) Eclipse, 然后進(jìn)入 Help > Install New Software.
2. 在 Available Software 對(duì)話框里,點(diǎn)擊 Add....
【錯(cuò)誤信息】
[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!
原因:
關(guān)閉模擬器和eclipse,執(zhí)行adb kill-server命令,然后重試一下
【錯(cuò)誤信息】
調(diào)用Webservice時(shí)出現(xiàn)
java.net.SocketException: Permission denied (maybe missing INTERNET permission)
原因:
需要訪問(wèn)到網(wǎng)絡(luò),所以,在AndroidManifest.xml中,需要進(jìn)行如下配置:
<uses-permission android:name="android.permission.INTERNET" />
【錯(cuò)誤信息】
org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <{http://schemas.xmlsoap.org/wsdl/}wsdl:definitions targetNamespace='http://bo.webservice.nqbx.nq.com'>@2:603 injava.io.InputStreamReader@44a3a7b0)
原因有可能是以下2個(gè)之一:
1)Webservice服務(wù)器的Soap版本為1.0,所以客戶端指定
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
VER11改為VER10
2)String serviceUrl = "http://200.200.200.11:10000/nqbx/service/InqBxWebService?wsdl";
Url指的是你的webservice的地址.一般都是以***.wsdl或者***.?wsdl結(jié)束的...但是.需要注意的是..要去掉后面的.wsdl或者.?wsdl
【錯(cuò)誤信息】
在新的線程中 public class HttpThread extends Thread {...}
增加一個(gè)彈出窗體:
new AlertDialog.Builder(this).setTitle("數(shù)據(jù)加載失敗").setMessage("請(qǐng)檢查網(wǎng)絡(luò)連接情況")           .setPositiveButton("OK", new DialogInterface.OnClickListener(){            public void onClick(DialogInterface dialoginterface, int i)            {            }            }).show();     
原因及解決辦法:
//不能在線程中操作UI界面
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
修改后:
new AlertDialog.Builder(com.nantsing.infoquery.chuanbo_detail.this).setTitle("數(shù)據(jù)加載失敗").setMessage("請(qǐng)檢查網(wǎng)絡(luò)連接情況")           .setPositiveButton("OK", new DialogInterface.OnClickListener(){            public void onClick(DialogInterface dialoginterface, int i)            {            }
【錯(cuò)誤信息】
The constructor AlertDialog.Builder(chuanbo_detail.HttpThread) is undefined
原因及解決辦法:
在UI主線程之外是無(wú)法對(duì)UI組件進(jìn)行控制的。因?yàn)槟惚仨氃谛戮€程任務(wù)完成之后利用各種方法先UI主線程發(fā)送消息通知任務(wù)完成從而來(lái)顯示各種提示消息。
線程間通信方法有多種,常用的是用handler來(lái)傳遞消息。

如下:
線程中構(gòu)造消息:
//構(gòu)造消息Message message = handle.obtainMessage();Bundle b = new Bundle();b.putString("tag", "1");message.setData(b);handle.sendMessage(message);
另外自定義消息:
        /** * 捕獲消息隊(duì)列 fubin.pan 2011-04-02 */Handler handler = new Handler() {public void handleMessage(Message m) {if (!m.getData().getString("tag").equals("1")){                            ...}else{new AlertDialog.Builder(chuanbo_detail.this).setTitle("數(shù)據(jù)加載失敗").setMessage("請(qǐng)檢查網(wǎng)絡(luò)連接情況!")                .setPositiveButton("OK", new DialogInterface.OnClickListener(){                        public void onClick(DialogInterface dialoginterface, int i)                        {                        }          }).show();}}};
【錯(cuò)誤信息】
android低版本工程(如1.5)放到高版本環(huán)境中(如2.2)可能會(huì)上述錯(cuò)誤,解決方法如下:
1。 如果不修改android sdk版本,則使用project clean 命令作用于某工程即可。
       (該處理方式只是在高版本中兼容了低版本工程,未真正意義上的升級(jí))
2。 如果修改android sdk版本,則需要以下幾個(gè)步驟:
       1)修改SDK
             選擇工程,build path --> configure build path ---> library 刪除引用的低版本SDK,
             然后add External JARs,選擇高版本SDK,OK,保存
        2)修改classpath文件
             該文件可能存在該項(xiàng): <classpathentry kind="lib"   path ="你所指定的高版本的地址"
             把她修改成<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK" />
        3) 修改AndroidManifest.xml
             在AndroidManifest.xml文件中,application標(biāo)簽后添加<uses-sdk android:minSdkVersion="3"></uses-sdk>
        4) 修改default.properties(很重要)
              該文件最后一行(前面沒(méi)用#的)target=android-3 該成target=android-8,保存。
        再看看你的工程和新建的android 2.2的工程結(jié)構(gòu)就一樣了。

【錯(cuò)誤信息】
在線程debug(運(yùn)行沒(méi)有問(wèn)題)時(shí)調(diào)用Webservice時(shí)出現(xiàn):
'JDI thread evaluations' has encountered a problem
Exception processing async thread queue

Exception processing async thread queue
JDI thread evaluations

原因及解決辦法:
與運(yùn)行無(wú)關(guān)的錯(cuò)誤,關(guān)掉'expressions'視圖就可以了
【錯(cuò)誤信息】
打開(kāi)開(kāi)源項(xiàng)目JavaEye Android client時(shí)出錯(cuò)
http://javaeye-android-client.googlecode.com/svn/trunk/
這是 JavaEye 網(wǎng)站基于 Android 平臺(tái)的客戶端軟件,可用以閱讀動(dòng)靜、帖子、閑談, 收躲, RSS 等功用。
[2011-04-19 10:55:11 - JavaEye Android Client] Project has no default.properties file! Edit the project properties to set one.
原因及解決辦法:
遇到這種情況,可以創(chuàng)建一個(gè)default.properties文件,如果創(chuàng)建之后還是有錯(cuò)誤,那么delete這個(gè)project,重新import。
編輯default.properties 之后,一般會(huì)自動(dòng)創(chuàng)建 gen 目錄, 如果沒(méi)有,也可嘗試手工創(chuàng)建。
✿Adroid Adapter ADB Interface 嚴(yán)重錯(cuò)誤
今天在配置完Eclipse和Android SDK開(kāi)發(fā)環(huán)境之后,想用華為C8500手機(jī)通過(guò)USB連接電腦,并在手機(jī)上去調(diào)試,但莫名其妙出現(xiàn)Adroid Adapter ADB Interface 安裝嚴(yán)重錯(cuò)誤,在豌豆莢手機(jī)精靈安裝驅(qū)動(dòng)的時(shí)候,也出現(xiàn)這個(gè)錯(cuò)誤,后面也莫名奇妙的多裝幾次就好了,還沒(méi)找到什么原因。
【錯(cuò)誤信息】
用手機(jī)調(diào)試運(yùn)行出現(xiàn):
ActivityManager: Warning: Activity not started, its current task has been brought to the front
原因及解決辦法:
該手機(jī)已經(jīng)啟動(dòng)了相同名字的應(yīng)用,關(guān)閉之后再試!
【錯(cuò)誤信息】
最近(2012-04-05)在打開(kāi)SDK Manager.exe,更新SDK時(shí),會(huì)出現(xiàn)如下錯(cuò)誤:

Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml,
reason: Connection timed out: connect
原因及解決辦法:
dl-ssl.google.com在大陸封掉了
解決方法就是修改C:\Windows\System32\drivers\etc\hosts文件。添加一行:
74.125.237.1       dl-ssl.google.com
保存,重新啟動(dòng)SDK Manager.exe
【錯(cuò)誤信息】
[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 connection 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:\android\android-sdk-windows\platform-tools\adb.exe' and can be executed.
原因及解決辦法:
查看任務(wù)管理器,關(guān)閉所有adb.exe
重啟eclipse即可
【錯(cuò)誤信息】
更新SDK時(shí)錯(cuò)誤信息:
Site Authentication
Please login to the following ......

原因及解決辦法:
Cancel跳過(guò)提示
【錯(cuò)誤信息】
打開(kāi)Eclipse 提示安裝ADT 17

原因及解決辦法:
最新的Android SDK只能安裝ADT 17.0.0
可用的下載地址:http://download.csdn.net/detail/merrido/4169460,
這里可不能用常規(guī)方法安裝這個(gè) ADT 17.0.0.zip 文件, 首先得解壓這個(gè)文件,將里面的文件夾覆蓋掉Eclipse安裝目錄下的文件夾。
然后再用Help-> install new software->Add -> Name: ADT   Archive:選擇ADT 17.0.0.zip
【錯(cuò)誤信息】
安裝ADT 17.0.0時(shí),提示:
Your original request has been modified.
  "Android DDMS" is already installed, so an update will be performed instead.
  "Android Development Tools" is already 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 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.adt.feature.group 17.0.0.v201203161636-291853) requires 'org.eclipse.core.runtime 3.6.0' but it could not be found
原因及解決辦法:
【錯(cuò)誤信息】
Updates ADT 17.0.0時(shí)提示:
Cannot complete the install because 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.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 found
requires 'org.eclipse.ui 3.6.0' but it could not be found
eclipse需要升級(jí)到3.6.0,我的版本是3.5.2
【錯(cuò)誤信息】
[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 Devices view.
原因及解決辦法:
重新啟動(dòng)eclipse
【錯(cuò)誤信息】
[2012-04-10 09:45:49 - adb] ADB server didn't ACK
[2012-04-10 09:45:49 - adb] * failed to start daemon *
原因及解決辦法:
查看任務(wù)管理器,關(guān)閉所有adb.exe
重啟eclipse
【錯(cuò)誤信息】
[2012-04-10 09:53:50 - ApiDemos] ------------------------------
[2012-04-10 09:53:50 - ApiDemos] Android Launch!
[2012-04-10 09:53:50 - ApiDemos] 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:\android\android-sdk-windows\platform-tools\adb.exe' and can be executed.
原因及解決辦法:
重啟eclipse
【錯(cuò)誤信息】
安裝android sdk時(shí):
-= 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 close any running programs that may be accessing the directory 'C:\android\android-sdk-windows/android-sdk-windows/too!s'. When ready, press YES to try again.

原因及解決辦法:
1, 復(fù)制 tools目錄
為一個(gè)新的目錄 tools-copy ,此時(shí)在android-sdk-windows 目錄下有兩個(gè)目錄 tools 和 tools-copy
2, 在tools-copy目錄以管理員身份運(yùn)行 android.bat ,這樣就可以正常 update all 了
3.重新運(yùn)行SDK Manager.exe.問(wèn)題解決!
【錯(cuò)誤信息】
“正在啟動(dòng)JavaEyeApiAccessor“遇到問(wèn)題。
不能連接至VM

原因及解決辦法:
連接不到手機(jī)虛擬機(jī)
重啟拔插手機(jī)連接線
【錯(cuò)誤信息】
調(diào)試的時(shí)候:
[2012-04-13 17:46:27 - IpsosAutoAndroid] Failed to install IpsosAutoAndroid.apk on device '?': timeout
[2012-04-13 17:46:27 - IpsosAutoAndroid] Launch canceled!
原因及解決辦法:
連接真機(jī)調(diào)試的時(shí)候如果連接太久沒(méi)響應(yīng)就會(huì)出現(xiàn)timeout
1.在window-》prensent....-》android-》設(shè)置ddms的timeout時(shí)間。這種是就最有效、最簡(jiǎn)潔的。
2.delete android里面的 apk,保證速度。不過(guò)試過(guò)一次后,真機(jī)好像變“聰明了”,也出現(xiàn)timeout。
3.Cleaning the project (Project->Clean),不行就重啟eclipse或者android,很郁悶的是,重啟后運(yùn)行第一次可以。第二次就開(kāi)始變慢了,也就是出現(xiàn)timeout
4.關(guān)閉eclipse ,然后再重啟,就ok
【錯(cuò)誤信息】
調(diào)用org.ksoap2.*訪問(wèn)webservice時(shí)
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......
【錯(cuò)誤信息】
Unable to open stack trace file '/data/anr/traces.txt': Permission denied
原因及解決辦法:
Unable to open stack trace file '/data/anr/traces.txt': Permission 多見(jiàn)于這個(gè)Activity你沒(méi)有在AndroidManifest.xml中注冊(cè),就會(huì)報(bào)這樣的錯(cuò)誤。
【錯(cuò)誤信息】
source not found
找不到源
原因及解決辦法:
android目錄下沒(méi)有對(duì)應(yīng)的sources文件

如下圖,不知道為什么,最新的SDK更新API 14/15中有Sources for Android SDK,而之前的版本的源碼就不更新,氣憤!

下載對(duì)應(yīng)的SDK Sources后,放到\android-sdk-windows\sources 目錄下就OK了!

【錯(cuò)誤信息】
Android使用KSOAP2調(diào)用WebService時(shí):
java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
原因及解決辦法:
雖然標(biāo)明上 Java Build Path->Libraries中已經(jīng)引用了ksoap2-android 包,但是需要order and export中也把該包勾選上

【錯(cuò)誤信息】

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
原因及解決辦法:
【錯(cuò)誤信息】
無(wú)法解析導(dǎo)入 com.renren.api.connect.android.R
原因及解決辦法:
導(dǎo)入android源碼有錯(cuò),R.java文件不能自動(dòng)生成解決方法
【錯(cuò)誤信息】
Eclipse中的DDMS無(wú)法打開(kāi)data文件夾下的內(nèi)容,也不能往里面寫東西
原因及解決辦法:
通過(guò)軟件獲取ROOT權(quán)限
【錯(cuò)誤信息】
Fri May 04 16:27:46 CST 2012
Internal error logged from JDI Debug:
org.eclipse.jdi.TimeoutException: 等待包 8 時(shí)發(fā)生超時(shí)。
at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:171)
at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:180)
......
原因及解決辦法:
重新啟動(dòng)eclipse,不行的話重啟機(jī)器
【錯(cuò)誤信息】
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
原因及解決辦法:
如下是有問(wèn)題的代碼:

 

 

 

 

 

 

 

Thread t = new Thread() {@Overridepublic void run() {super.run();try {QuestionItemlist = quesHandler.getData();if (QuestionItemlist.size() == 0) {Toast.makeText(questionitemlist2.this,"問(wèn)卷題目為空",Toast.LENGTH_LONG).show();} else {Toast.makeText(questionitemlist2.this,"問(wèn)卷題目已經(jīng)獲取",Toast.LENGTH_LONG).show();}} catch (Exception e) {e.printStackTrace();}}};t.start();【錯(cuò)誤信息】

java.lang.IllegalArgumentException: The key must be an application-specific resource id.

原因及解決辦法:
mRadioButton.setTag(1,sQuestionItem.get(i).getToNext());//設(shè)置監(jiān)聽(tīng)  ToNext:下一題目mRadioButton.setTag(2,sQuestionItem.get(i).getToEnd());//設(shè)置監(jiān)聽(tīng)  ToEnd:是否終止 拋出IllegalArgumentException的原因就在于key不唯一,正確代碼如下:
mRadioButton.setTag(R.id.tag_tonext,sQuestionItem.get(i).getToNext());//設(shè)置監(jiān)聽(tīng)  ToNext:下一題目mRadioButton.setTag(R.id.tag_toend,sQuestionItem.get(i).getToEnd());//設(shè)置監(jiān)聽(tīng)  ToEnd:是否終止
【錯(cuò)誤信息】
點(diǎn)擊Debug 運(yùn)行 結(jié)果模擬器總是會(huì)彈出Waiting for Debugger 然后程序又可以正常運(yùn)行
如果你想調(diào)試的時(shí)候去掉 Waiting for Debugger 提示
原因及解決辦法:
重啟啟動(dòng)機(jī)器就OK

責(zé)任編輯:張葉青 來(lái)源: eoe Android開(kāi)發(fā)者社區(qū)
相關(guān)推薦

2020-10-18 12:00:27

前端開(kāi)發(fā)架構(gòu)

2009-09-02 17:20:55

Linux郵件服務(wù)器

2009-06-19 17:29:12

Struts常見(jiàn)錯(cuò)誤J2EE

2019-11-15 14:14:13

Python開(kāi)發(fā)BaseExcepti

2018-07-03 15:29:00

2020-11-05 18:53:15

JavaScript開(kāi)發(fā)前端

2020-02-05 08:56:54

物聯(lián)網(wǎng)安全物聯(lián)網(wǎng)攻擊

2009-12-30 15:29:14

2010-09-02 08:44:12

CSS

2021-12-27 08:58:28

低代碼開(kāi)發(fā)數(shù)據(jù)安全

2009-09-22 09:22:03

.NET常見(jiàn)問(wèn)題

2012-02-06 10:37:07

Java

2009-06-16 14:03:16

Hibernate面試Hibernate面試

2010-05-13 13:27:23

2010-04-16 14:55:12

ORACLE鎖

2013-09-13 14:43:16

2020-09-23 22:40:31

Python 開(kāi)發(fā)編程語(yǔ)言

2011-01-19 15:52:18

Qmail錯(cuò)誤代碼

2020-02-21 08:45:45

PythonWeb開(kāi)發(fā)框架

2020-12-28 11:08:18

MySQL數(shù)據(jù)庫(kù)服務(wù)器
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)