這是因為import的項目沒有 default.properties 這個檔案引起到,該檔案記錄項目中所需要的環境資訊,比如Android的版本等。 一般的default.properties檔案代碼如下所示,代碼中的注釋已經把default.properties解釋得很清楚了,如果某個項目沒有default.properties這個檔案,我們可以直接從其他項目中拷貝過來使用。“target=android-8“表示使用android 2.2平台開發。
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-8
我們如果在ecplise中添加了default.properties,項目可能還是有錯誤,我們需要重新import這個項目,這個ecplise就能自動給項目生成一個gen檔案夾,并添加“Android 2.2“的庫檔案夾。
本文轉自xwdreamer部落格園部落格,原文連結:http://www.cnblogs.com/xwdreamer/archive/2010/08/24/2297103.html,如需轉載請自行聯系原作者