【錯誤信息】html
[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)java
緣由:android
不影響正常運行。在AndroidManifest.xml文件中沒有加API的版本號,在<manifest> </manifest> 之間加<uses-sdk android:minSdkVersion="3"></uses-sdk>web
[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!express
該設備沒有足夠的存儲空間來安裝應用程序,apache
【錯誤信息】windows
[2011-02-18 11:46:53] Failed to push selection: Is a directoryapi
緣由:服務器
原先目錄已經有pkg_3.apk的文件夾,再copy一個pkg_3.apk安裝文件時出現問題,解決辦法,先刪除掉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
緣由:
【錯誤信息】
啓動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 > Install 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!
緣由:
關閉模擬器和eclipse,執行adb kill-server命令,而後重試一下
【錯誤信息】
調用Webservice時出現
java.net.SocketException: Permission denied (maybe missing INTERNET permission)
緣由:
須要訪問到網絡,因此,在AndroidManifest.xml中,須要進行以下配置:
<uses-permission android:name="android.permission.INTERNET" />
【錯誤信息】
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個之一:
1)Webservice服務器的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結束的...可是.須要注意的是..要去掉後面的.wsdl或者.?wsdl
【錯誤信息】
在新的線程中 public class HttpThread extends Thread {...}
增長一個彈出窗體:
[java] view plaincopy
new AlertDialog.Builder(this).setTitle("數據加載失敗").setMessage("請檢查網絡鏈接狀況") .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()
修改後:
[java] view plaincopy
<span style="font-size:14px;" class="Apple-style-span">new AlertDialog.Builder(com.nantsing.infoquery.chuanbo_detail.this).setTitle("數據加載失敗").setMessage("請檢查網絡鏈接狀況") .setPositiveButton("OK", new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialoginterface, int i) { }</span>
【錯誤信息】
The constructor AlertDialog.Builder(chuanbo_detail.HttpThread) is undefined
緣由及解決辦法:
在UI主線程以外是沒法對UI組件進行控制的。由於你必須在新線程任務完成以後利用各類方法先UI主線程發送消息通知任務完成從而來顯示各類提示消息。
線程間通訊方法有多種,經常使用的是用handler來傳遞消息。
以下:
線程中構造消息:
[java] view plaincopy
//構造消息Message message = handle.obtainMessage();Bundle b = new Bundle();b.putString("tag", "1");message.setData(b);handle.sendMessage(message);
另外自定義消息:
[c-sharp] view plaincopy
/** * 捕獲消息隊列 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("數據加載失敗").setMessage("請檢查網絡鏈接狀況!") .setPositiveButton("OK", new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialoginterface, int i) { } }).show();}}};
【錯誤信息】
android低版本工程(如1.5)放到高版本環境中(如2.2)可能會上述錯誤,解決方法以下:
1。 若是不修改android sdk版本,則使用project clean 命令做用於某工程便可。
(該處理方式只是在高版本中兼容了低版本工程,未真正意義上的升級)
2。 若是修改android sdk版本,則須要如下幾個步驟:
1)修改SDK
選擇工程,build path --> configure build path ---> library 刪除引用的低版本SDK,
而後add External JARs,選擇高版本SDK,OK,保存
2)修改classpath文件
該文件可能存在該項: <classpathentry kind="lib" path ="你所指定的高版本的地址"
把她修改爲<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK" />
3) 修改AndroidManifest.xml
在AndroidManifest.xml文件中,application標籤後添加<uses-sdk android:minSdkVersion="3"></uses-sdk>
4) 修改default.properties(很重要)
該文件最後一行(前面沒用#的)target=android-3 該成target=android-8,保存。
再看看你的工程和新建的android 2.2的工程結構就同樣了。
【錯誤信息】
在線程debug(運行沒有問題)時調用Webservice時出現:
'JDI thread evaluations' has encountered a problem
Exception processing async thread queue
Exception processing async thread queue
JDI thread evaluations
處理異步現場隊列時發生了異常
JDI線程求值
緣由及解決辦法:
與運行無關的錯誤,關掉'expressions'視圖就能夠了
【錯誤信息】
打開開源項目JavaEye Android client時出錯
http://javaeye-android-client.googlecode.com/svn/trunk/
這是 JavaEye 網站基於 Android 平臺的客戶端軟件,可用以閱讀動靜、帖子、閒談, 收躲, RSS 等功用。
[2011-04-19 10:55:11 - JavaEye Android Client] Project has no default.properties file! Edit the project properties to set one.
緣由及解決辦法:
遇到這種狀況,能夠建立一個default.properties文件,若是建立以後仍是有錯誤,那麼delete這個project,從新import。
編輯default.properties 以後,通常會自動建立 gen 目錄, 若是沒有,也可嘗試手工建立。
✿Adroid Adapter ADB Interface 嚴重錯誤
今天在配置完Eclipse和Android SDK開發環境以後,想用華爲C8500手機經過USB鏈接電腦,並在手機上去調試,但莫名其妙出現Adroid Adapter ADB Interface 安裝嚴重錯誤,在豌豆莢手機精靈安裝驅動的時候,也出現這個錯誤,後面也莫名奇妙的多裝幾回就行了,還沒找到什麼緣由。
【錯誤信息】
用手機調試運行出現:
ActivityManager: Warning: Activity not started, its current task has been brought to the front
緣由及解決辦法:
該手機已經啓動了相同名字的應用,關閉以後再試!
【錯誤信息】
最近(2012-04-05)在打開SDK Manager.exe,更新SDK時,會出現以下錯誤:
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文件。添加一行:
[html] view plaincopy
<span style="font-size:14px">74.125.237.1 dl-ssl.google.com</span>
保存,從新啓動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 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.
緣由及解決辦法:
查看任務管理器,關閉全部adb.exe
重啓eclipse便可
【錯誤信息】
更新SDK時錯誤信息:
Site Authentication
Please login to the following ......
緣由及解決辦法:
Cancel跳過提示
【錯誤信息】
打開Eclipse 提示安裝ADT 17
This Android SDK requires Android Developer Toolkit version 17.0.0 or above.
Current version is 15.0.0.V201110251216-213216.
Please update ADT to latest version.
緣由及解決辦法:
最新的Android SDK只能安裝ADT 17.0.0
可用的下載地址:http://download.csdn.net/detail/merrido/4169460,
這裏可不能用常規方法安裝這個 ADT 17.0.0.zip 文件, 首先得解壓這個文件,將裏面的文件夾覆蓋掉Eclipse安裝目錄下的文件夾。
而後再用Help-> 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 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
緣由及解決辦法:
requires 'org.eclipse.core.runtime 3.6.0' but it could not be found
eclipse須要升級到3.6.0,個人版本是3.5.2
【錯誤信息】
Updates ADT 17.0.0時提示:
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須要升級到3.6.0,個人版本是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 Devices view.
緣由及解決辦法:
從新啓動eclipse
【錯誤信息】
[2012-04-10 09:45:49 - adb] ADB server didn't ACK
[2012-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 - 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
【錯誤信息】
安裝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 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, 複製 tools目錄
爲一個新的目錄 tools-copy ,此時在android-sdk-windows 目錄下有兩個目錄 tools 和 tools-copy
2, 在tools-copy目錄以管理員身份運行 android.bat ,這樣就能夠正常 update all 了
3.從新運行SDK Manager.exe.問題解決!
【錯誤信息】
「正在啓動JavaEyeApiAccessor「遇到問題。
不能鏈接至VM
緣由及解決辦法:
鏈接不到手機虛擬機
重啓拔插手機鏈接線
【錯誤信息】
調試的時候:
[2012-04-13 17:46:27 - IpsosAutoAndroid] Failed to install IpsosAutoAndroid.apk on device '?': timeout
[2012-04-13 17:46:27 - IpsosAutoAndroid] Launch canceled!
緣由及解決辦法:
鏈接真機調試的時候若是鏈接過久沒響應就會出現timeout
1.在window-》prensent....-》android-》設置ddms的timeout時間。這種是就最有效、最簡潔的。
2.delete android裏面的 apk,保證速度。不過試過一次後,真機好像變「聰明瞭」,也出現timeout。
3.Cleaning the project (Project->Clean),不行就重啓eclipse或者android,很鬱悶的是,重啓後運行第一次能夠。第二次就開始變慢了,也就是出現timeout
4.關閉eclipse ,而後再重啓,就ok
【錯誤信息】
調用org.ksoap2.*訪問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 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 for Android SDK,而以前的版本的源碼就不更新,氣憤!
下載對應的SDK Sources後,放到\android-sdk-windows\sources 目錄下就OK了!
【錯誤信息】
Android使用KSOAP2調用WebService時:
java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
緣由及解決辦法:
雖然標明上 Java Build Path->Libraries中已經引用了ksoap2-android 包,可是須要order and export中也把該包勾選上
【錯誤信息】
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.android.R
緣由及解決辦法:
導入android源碼有錯,R.java文件不能自動生成解決方法
【錯誤信息】
Eclipse中的DDMS沒法打開data文件夾下的內容,也不能往裏面寫東西
緣由及解決辦法:
經過軟件獲取ROOT權限
【錯誤信息】
Fri May 04 16:27:46 CST 2012
Internal error logged from JDI Debug:
org.eclipse.jdi.TimeoutException: 等待包 8 時發生超時。
at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:171)
at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:180)
......
緣由及解決辦法:
從新啓動eclipse,不行的話重啓機器
【錯誤信息】
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
緣由及解決辦法:
以下是有問題的代碼:
[java] view plaincopy
<span style="font-size:14px"> Thread t = new Thread() {
@Override
public void run() {
super.run();
try {
QuestionItemlist = quesHandler.getData();
if (QuestionItemlist.size() == 0) {
Toast.makeText(questionitemlist2.this,"問卷題目爲空",Toast.LENGTH_LONG).show();
} else {
Toast.makeText(questionitemlist2.this,"問卷題目已經獲取",Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
};
t.start();</span>
【錯誤信息】
java.lang.IllegalArgumentException: The key must be an application-specific resource id.
緣由及解決辦法:
[java] view plaincopy
<span style="font-size:14px">mRadioButton.setTag(1,sQuestionItem.get(i).getToNext());//設置監聽 ToNext:下一題目
mRadioButton.setTag(2,sQuestionItem.get(i).getToEnd());//設置監聽 ToEnd:是否終止</span>
拋出IllegalArgumentException的緣由就在於key不惟一,正確代碼以下:
[java] view plaincopy
<span style="font-size:14px">mRadioButton.setTag(R.id.tag_tonext,sQuestionItem.get(i).getToNext());//設置監聽 ToNext:下一題目
mRadioButton.setTag(R.id.tag_toend,sQuestionItem.get(i).getToEnd());//設置監聽 ToEnd:是否終止</span>
【錯誤信息】
點擊Debug 運行 結果模擬器老是會彈出Waiting for Debugger 而後程序又能夠正常運行
若是你想調試的時候去掉 Waiting for Debugger 提示
緣由及解決辦法:
重啓啓動平板電腦機器就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 found 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 has no project.properties 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 ,查看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 "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 console
[2012-09-09 00:15:34 - IpsosAutoAndroid] Note: there were 4 duplicate class definitions.
[2012-09-09 00:15:34 - IpsosAutoAndroid] Warning: library class android.content.res.XmlResourceParser extends or implements program class org.xmlpull.v1.XmlPullParser
[2012-09-09 00:15:34 - IpsosAutoAndroid] Warning: library class android.content.Intent depends on program class org.xmlpull.v1.XmlPullParser
[2012-09-09 00:15:34 - IpsosAutoAndroid] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlPullParser
[2012-09-09 00:15:34 - IpsosAutoAndroid] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlSerializer
[2012-09-09 00:15:34 - IpsosAutoAndroid] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlPullParser
[2012-09-09 00:15:34 - IpsosAutoAndroid] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2012-09-09 00:15:34 - IpsosAutoAndroid] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2012-09-09 00:15:34 - IpsosAutoAndroid] You should check if you need to specify additional program jars.
[2012-09-09 00:15:34 - IpsosAutoAndroid] Warning: there were 7 instances of library classes depending on program classes.
[2012-09-09 00:15:34 - IpsosAutoAndroid] You must avoid such dependencies, since the program classes will
[2012-09-09 00:15:34 - IpsosAutoAndroid] be processed, while the library classes will remain unchanged.
[2012-09-09 00:15:34 - IpsosAutoAndroid] java.io.IOException: Please correct the above warnings first.
[2012-09-09 00:15:34 - IpsosAutoAndroid] at proguard.Initializer.execute(Initializer.java:321)
[2012-09-09 00:15:34 - IpsosAutoAndroid] at proguard.ProGuard.initialize(ProGuard.java:211)
[2012-09-09 00:15:34 - IpsosAutoAndroid] at proguard.ProGuard.execute(ProGuard.java:86)
[2012-09-09 00:15:34 - IpsosAutoAndroid] at proguard.ProGuard.main(ProGuard.java:492)
緣由及解決辦法:
多是由於引用了第三方開發包:ksoap2-android-assembly-2.4-jar-with-dependencies.jar
不須要混淆的把混淆的proguard.cfg去掉就行了
Or
在proguard.cfg中增長一行
-ignorewarnings
http://www.eoeandroid.com/thread-114519-1-1.html
【錯誤信息】
打開eclipse出現以下錯誤:
描述 資源 路徑 位置 類型
Error generating final archive: Debug Certificate expired on 12-10-18 下午12:10 IpsosAutoAndroid 未知
Android Packaging Problem
緣由及解決辦法:
進入C:\Documents and Settings\Administrator\.android 刪除路徑下的debug.keystore及 ddms.cfg。
【錯誤信息】
經過包:ksoap2-android-assembly-2.4-jar-with-dependencies.jar調用webservice時,在以下代碼中出錯:
SoapObject request = new SoapObject(Constant.NAMESPACE, methodName);
緣由及解決辦法:
java構建路徑時,引用包時目錄路徑不能有中文字體。
【錯誤信息】
想經過Service啓動安裝文件時
UpdateService.this.startActivity(i);
出現以下錯誤:
android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
緣由及解決辦法:
Intent後須要添加setFlags:
Intent i = new Intent(Intent.ACTION_VIEW);
it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
【錯誤信息】
java.lang.NoSuchMethodError:android.util.Xml.newSerializer
調試狀態,調用XML序列化拼接代碼沒有問題
XmlSerializer serializer = Xml.newSerializer();
可是簽名發佈以後,卻報運行時錯誤
緣由及解決辦法:
初步判斷是Android用ProGuard混淆後,xmlpull與另一個引用包中的ksoap2-android-assembly-2.4-jar-with-dependencies.jar衝突
解決辦法是首先用快壓打開ksoap2-android-assembly-2.4-jar-with-dependencies.jar包,而後把對應的org.xmlpull.v1.XmlPullParser和org.xmlpull.v1.XmlSerializer去掉,就OK了。這兩個包與自帶的包衝突了
【錯誤信息】
Eclipse安裝了中文包後就沒有辦法調試進入查看源代碼,並出現下面的錯誤:
未能打開編輯器:Unmatched braces in the pattern.
解決辦法:
配置本身Eclipse的啓動參數 eclipse.ini 在最後面加入這段代碼 -Duser.language=en
而後打開Eclipse 這是Eclipse應該變爲英文的了
點擊attach source
選擇 src.zip包 在java jdk下面
英文界面顯示成功
下面切換回來中文 把剛纔在eclipse.ini裏添加的 最後那一段刪除 重啓Eclipse
點擊源代碼查看 大功告成
【錯誤信息】
調試的時候,一直停留 waiting for debugger Application ......is waiting for the debugger to attach
解決辦法:
同時打開多個eclipse進行調試,須要關閉掉一個
這時模擬器可能不能正確辨別是哪一個eclipse正在進行debug
從而會一直停留在「等待調試器鏈接」的提示上
【錯誤信息】
[2013-09-06 18:05:50 - Q***Android] Failed to install Q***Android.apk on device '?': Too many open files
[2013-09-06 18:05:50 - Q***Android] com.android.ddmlib.SyncException: Too many open files
[2013-09-06 18:05:50 - Q***Android] Launch canceled!
解決辦法:
解決方法1:拔掉手機鏈接線再從新連上;
解決方法2:在手機上關閉Debug選項再從新打開,這個選項在手機的"設置->應用程序->開發->USB調試"裏。
【錯誤信息】
線程Thread()中刷新界面控件賦值時出現以下錯誤:
Only the original thread that created a view hierarchy can touch its views.
解決辦法:
須要使用Android異步處理,使用Thread+Handler實現非UI線程更新UI界面
【錯誤信息】
ScrollView can host only one direct child
解決辦法:
ScrollView內部只能有一個子元素,即不能並列兩個子元素,因此須要把全部的子元素放到一個LinearLayout內部或RelativeLayout等其餘佈局方式讓後再在這個layout外部用scrollview包住。
【錯誤信息】
error: Error: No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/txtJiangli_Out_all').
[java] view plaincopy
<TextView android:id="@+id/txtJiangliOut"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/jiangliOut"
android:layout_toLeftOf="@id/txtJiangli_Out_all"
style="@style/normalText"
/>
<TextView
android:id="@+id/txtJiangli_Out_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="0.0元"
style="@style/normalText"
/>
"txtJiangli_Out_all"向右看齊,「txtJiangliOut」靠齊"txtJiangli_Out_all"控件,但如上會出錯,問題在哪?
解決辦法:
因爲"txtJiangli_Out_all"控件擺放在「txtJiangliOut」前面,因此就找不到後面的控件,因此把順序換下就行了,以下:
[java] view plaincopy
<TextView
android:id="@+id/txtJiangli_Out_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="0.0元"
style="@style/normalText"
/>
<TextView android:id="@+id/txtJiangliOut"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/jiangliOut"
android:layout_toLeftOf="@id/txtJiangli_Out_all"
style="@style/normalText"
/>
【錯誤信息】
操做系統換成了WIN8,在建立模擬器後,啓動模擬器提示:
PANIC: Could not open AVD config file:c:\user\亂碼\....
解決方法:
在個人電腦右鍵屬性配置系統環境變量
名稱:ANDROID_SDK_HOME
路徑:C:\android\android-sdk-windows 這個路徑你能夠隨便但不要有中文
而後找到eclipse安裝路徑找到
好比個人:E:\JAVA\eclipse-java-indigo-SR1-win32\eclipse\configuration\.settings
找到org.eclipse.ui.ide.prefs 文件 用記事本打開
在最後面加上環境變量中添加的路徑
ANDROID_SDK_Home=C\:\\android\\android-sdk-windows 注意這裏的反斜槓
重啓eclipse 從新建立模擬器