開發時間過程中遇到的一些問題

來源:互聯網
上載者:User

1、安裝apk檔案出現相應的錯誤

(1)提示錯誤OLDER_SDK,這表明現有的android的sdk版本太低,應該使用較高版本的sdk。

(2)提示錯誤UPDATE_INCOMPATIABLE,這表明apk與現有的sdk存在相容性上的衝突,可以檢查一下是否使用了完全一樣的skin等參數設定,這些參數與apk應用程式的不一致也會導致安裝時候出現錯誤。

(3) 有時安裝apk沒有出現錯誤,但是一運行就出現“程式異常終止”的錯誤:

         原因一般有:應用程式的許可權沒有設定好,出現了問題;應用程式可能會使用sdcard,而沒有掛載sdcard鏡像。

(4)目前Android的開發主要是基於800*480(WVQA800)的皮膚,皮膚的不同可能會影響應用程式的相容性。

 

2、在模擬器的sdcard鏡像插入的圖片後,不能通過圖片瀏覽器進行顯示。

如果是在android啟動並執行過程中,往sdcard中插入圖片,不會立即顯示出來,需要重啟android虛擬器。

 

 3、開發Android應用程式,容易忽視的一點就是:忘記給應用程式賦予合適的存取權限。<uses-permission>

在通過DDMS類比GPS定位時,模擬器在install apk之後,始終顯示“無法顯示物理位置”的錯誤資訊,後來重啟一下,就可以了。所以得到啟發:如果某個應用程式有一定問題的話,嘗試把android重啟一下,或許就可以了!

 

4、android的Google MAP相關內容

 

(1)Google MAP API的擷取

Android Maps API Key Signup

The Android Maps API lets you embed Google Maps in your own Android applications. A single Maps API key is valid for all applications signed by a single certificate.

You also need a Google Account to get a Maps API key, and your API key will be connected to your Google Account.

 

Android Market enables developers to easily publish and distribute their applications directly to users of Android-compatible phones.

 

(2)運行android與Google Map相關的應用程式時,提示錯誤:Failed to find an AVD compatible with target 'Google APIs'.

其實問題在於:之前應用程式載入的都是沒有Google api的android21的平台,google api是可選包。所以必須重新建立一個有android和google api的21平台。

 

 5、如何匯入Android SDK中的Sample代碼

(1)不能通過file->import來載入,因為這裡import是已經建立好的工程,而Sample中的只是source檔案

(2)所以需要file->new->android project->creating project from existing sample.在下拉框中選擇具體的Sample。

        注意不能選擇creating projects from exisiting source,這樣建立的工程是有錯誤的,沒有R.java檔案。

 (3)出現的沒有R.java檔案的問題:

存在這樣一種可能:由於res目錄的一些xml檔案中對於單引號沒有使用“/”進行轉義,這個還是通過console中的錯誤提示看出來的。

 

6、安裝改進版本後的apk檔案出現如下的錯誤

Com.xiedong.calendar:

signatures do not match the previously installed version ignoring

Package couldn't not be installed  in /data/app/com.xiedong.calendar.apk

 

解決方案:

(1)刪除之前建立的avd,然後重新建立,編譯和運行

(2)或者在已經存在的avd基礎上,啟動過程中選擇上 wipe user data 如所示

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.