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

Android錯(cuò)誤解決方法大集合

移動(dòng)開發(fā) Android
或許困擾很多Android開發(fā)者最大的問題莫過于Bug的修改了,調(diào)Bug 改Bug,想想都頭疼,以下就是一位對(duì)Bug很有經(jīng)驗(yàn)的開發(fā)者總結(jié)出來的有關(guān)Android錯(cuò)誤的解決方法。

1 android java.net.UnknownHostException: Unable to resolve host "...": No address associated 錯(cuò)誤
我在android開發(fā)的時(shí)候經(jīng)常會(huì)遇到這個(gè)錯(cuò)誤,一般來說,造成這種錯(cuò)誤的最普遍情況有兩種:

1.android設(shè)備網(wǎng)絡(luò)連接沒打開,例如3G網(wǎng)絡(luò)和WIFI網(wǎng)絡(luò)

所以,如果遇到這種錯(cuò)誤時(shí),請先查看網(wǎng)絡(luò)是否已正常連接.

2.Manifest文件沒有標(biāo)明網(wǎng)絡(luò)訪問權(quán)限

如果確認(rèn)網(wǎng)絡(luò)已經(jīng)正常連接并且還是出這種錯(cuò)誤的話,那么請看下你的Manifest文件是否標(biāo)明應(yīng)用需要網(wǎng)絡(luò)訪問權(quán)限,如果沒標(biāo)明的話,也訪問不了網(wǎng)絡(luò),也會(huì)造成這種情況的.

//網(wǎng)絡(luò)訪問權(quán)限

2 Failed to install *.apk on device 'emulator-5554': timeout

錯(cuò)誤提示:

Failed to install helloworld.apk on device 'emulator-5554': timeout

或者

the user data image is used

原因:

由于模擬器已經(jīng)開啟而沒有關(guān)閉或者非法關(guān)閉引起的。

解決方法:

刪除 C:Documents and SettingsAdministrator.androidavd對(duì)應(yīng)版本.avd

下所有以.lock結(jié)尾的文件夾。

或者

Failed to install *.apk on device *:

timeout Launch canceled!

還有一種辦法:

在window->preferences->Android->DDMS->ADB connection time out (ms):

將這個(gè)值設(shè)置的大一些,默認(rèn)為5000,設(shè)置成500000,然后就OK了。

3 This Android SDK requires Andriod Developer Toolkit version 20.0.0 or above
打開Eclipse(Android 開發(fā)環(huán)境),發(fā)現(xiàn)以下報(bào)錯(cuò):

1346673984_5685.jpg

圖片顯示信息為:Android SDK要求ADT(Android Developer Toolkit)版本在20.0.0或以上版本,檢測到當(dāng)前版本為18.0.0,請更新最新的ADT。

出現(xiàn)這樣的提示,根本原因是Eclipse啟動(dòng)時(shí)檢測E:Program Filesandroid-sdk-windowstoolslibplugin.prop文件 文件內(nèi)容為:

begin plugin.prop

plugin.version=20.0.0

# end plugin.prop

這就很容易理解了,需求插件版本為20.0.0,這時(shí)候我們只需要改成:

begin plugin.prop

plugin.version=18.0.0

# end plugin.prop

OK了,重新啟動(dòng)下Eclipse,看看是不是解決了這個(gè)問題

4 [Accessibility] Missing contentDescription attribute on image

今天使用了下ADT 16.0 在定義一個(gè)ImageVIew的時(shí)候 總是提示這個(gè)[Accessibility] Missing contentDescription attribute on image警告,雖說可以不理 但總是感覺怪怪的,在網(wǎng)上一搜 發(fā)現(xiàn)原來這是ADT 16.0的新特性,在一些沒有文本顯示的控件里,如imageView和imageButton等,ADT會(huì)提示你定義一個(gè)android:contentDescription屬性,用來描述這個(gè)控件的作用。英文原文如下,如有翻譯的不對(duì)的地方,敬請批評(píng)指正。

Resolved this warning by setting attribute android:contentDescription for my ImageView

android:contentDescription="@string/desc"

Android Lint support in ADT 16 throws this warning to ensure that image widgets provide a contentDescription

This defines text that briefly describes content of the view. This property is used primarily for accessibility. Since some views do not have textual representation this attribute can be used for providing such.

Non-textual widgets like ImageViews and ImageButtons should use the contentDescription attribute to specify a textual description of the widget such that screen readers and other accessibility tools can adequately describe the user interface.

5 java.lang.NoClassDefFoundError: com.baidu.mapapi.BMapManager解決辦法

用百度地圖,可能把工程復(fù)制了些位置 出錯(cuò)了

解決辦法:

1.右擊項(xiàng)目->properties->Java Build Path->Order and Export,在需要引用的包前面打勾。

2.Project->Clean...

clipboard.png

6 eclipse中提示 No Completions Available,Alt+/不自動(dòng)提示

window-> Preferences-> Java-> Editor-> Content Assist-> Advanced

上面的選項(xiàng)卡Select the proposal kinds contained in the 'default' content assist list中添加【Java Non-Type Proposals】

clipboard1.png

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

2014-05-15 15:29:09

Android開發(fā)資源

2012-04-28 10:29:24

jQuery

2010-02-03 09:53:08

Python版本

2011-05-16 09:54:22

mysql1067錯(cuò)誤

2010-07-14 14:02:52

SQL Server數(shù)

2012-01-05 10:19:43

JavaScript

2011-07-04 10:33:22

QT

2010-07-26 09:06:09

SQL Server游

2009-12-18 11:03:45

Ruby watir環(huán)

2017-04-07 09:02:06

Spark方法優(yōu)化

2010-02-24 10:52:24

IBM中端服務(wù)器

2010-06-09 17:00:43

UML試題

2011-06-21 10:44:32

QT QTE

2010-10-20 17:31:40

Fedora應(yīng)用

2009-01-07 10:30:25

2014-06-12 17:02:46

世界杯手游

2018-12-17 09:00:00

大數(shù)據(jù)數(shù)據(jù)科學(xué)工具

2009-08-24 11:04:56

2010-08-04 09:57:28

路由器

2010-10-12 14:28:54

點(diǎn)贊
收藏

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