我得到這個錯誤在我的Android模擬器:造成的HTTPClient應用強行關閉
對不起 應用程序意外終止。請再試一次。 [強制關閉]
我認爲創建錯誤的代碼是這樣的: HttpClient client = new HttpClient();
我已導入從JARS如下:
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.PostMethod;
任何想法?有沒有辦法獲得有關錯誤的更多細節?上述消息是不是非常有幫助?
堆棧跟蹤:
我已經看了這一點,我覺得這是問題。 (這是太長時間後都在這裏..)
E/dalvikvm( 757): Could not find class 'org.apache.commons.httpclient.HttpClient', referenced from method com.projectNoble.androidClient.serverComms.initCommunication
W/dalvikvm( 757): VFY: unable to resolve new-instance 46 (Lorg/apache/commons/httpclient/HttpClient;) in Lcom/projectNoble/androidClient/serverComms;
W/dalvikvm( 757): VFY: rejecting opcode 0x22 at 0x0000
W/dalvikvm( 757): VFY: rejected Lcom/projectNoble/androidClient/serverComms;.initCommunication()Ljava/lang/String;
W/dalvikvm( 757): Verifier rejected class Lcom/projectNoble/androidClient/serverComms;
D/AndroidRuntime( 757): Shutting down VM
源代碼
可在此頁底部找到: http://hc.apache.org/httpclient-3.x/tutorial.html
發表您的堆棧跟蹤和代碼... – RoflcoptrException 2010-05-25 15:47:10
呀,類型亞行logcat,並獲得實際堆棧跟蹤。 – synic 2010-05-25 15:48:20
對不起,但你如何獲得堆棧跟蹤? 代碼明智我已經評論全部出來,它仍然發生在第一行:HttpClient client = new HttpClient(); 謝謝 – Mith 2010-05-25 15:48:34