Android常見錯誤處理(三)

來源:互聯網
上載者:User

標籤:android   異常   

1.java.net.SocketException: Noroute to host

解決辦法:關閉防火牆/網路有問題,重新串連 WIFI 或者檢查網路連接埠。

2.Failed to install xxx.apk on device ‘xxxxxxxxx’: Unable to open sync connection!

java.io.IOException: Unable to open sync connection!

Launch canceled!

解決辦法:一般是因為裝置沒串連好,確認手機開啟了開發人員模式,並且串連上電腦就可以

3.res\values\style.xml:44:error: Error retrieving parent for item: No resource found that matches the given name ‘android:WindowTitleBackground’

解決辦法:把”android:WindowTitleBackground”>改為”*android:WindowTitleBackground”>

4.Caused by: android.view.InflateException: Binary XML file line #244: Error inflating class XXXX

解決辦法:我在自訂控制項或使用自訂控制項時常常遇見這個問題,問題的根源在於沒有正確地使用自訂控制項/自訂控制項需要某些必須的屬性,而我們在初始化時沒有為這個屬性賦值,報這個錯時需要回到源碼分析,沒有通用的解決辦法

5.Failed to install *.apk on device ‘emulator-5554’: timeout

解決辦法:出現這個問題一般是因為沒有正確地關閉虛擬機器,或者是虛擬機器已經啟動,卻沒有顯示。我們可以刪除對應的虛擬機器目錄下.lock檔案,也可以在window->preferences->Android->DDMS->ADB connection time out (ms),把值設定的大一些

Android常見錯誤處理(三)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.