Eclipse匯入Android項目的問題

來源:互聯網
上載者:User

出現錯誤的可能情況:

 

(1)SDK的問題:

正確安裝Android SDK後,將其安裝目錄下的tools檔案夾路徑,加入到環境變數Path

 

在eclipse中添加SDK:Windows —>preference —>Android,設定SDK Location

 

對於某一個項目的問題,還可以嘗試直接右擊項目,properties—>Java Build Path—>Add Jars,添加

SDK安裝目錄:android-sdk-windows/platforms/android-9 下   android.jar檔案

 

 (2)匯入方式錯誤:

 

1.可以建立一個Android項目:File —>new —>android project —>create project from existing source

 

2.用import匯入: File —>import—>general—>Existing project into workspace 找到要開啟的源檔案

 

(3)注意SDK版本問題!

 

如果匯入時,eclipse的console中提示資訊:“Unable to resolve target 'android-5'”

 

可能的問題就是你安裝的SDK版本高於項目的版本!(例如:你安裝的是Android 2.3,而項目是2.0)

 

這個時候要修改項目下的default.properties,將target 改為anroid-9 (即最高版本的SDK)

 

(4)此項目需要用到資料庫,而我們沒有這個資料庫……

 

例如:匯入一個電話本的程式ListView,就需要準備相應的連絡人資料庫

聯繫我們

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