2012-12-18 22 views
1

使用我當前的android工具,我可以在Eclipse中構建一個android項目。當我嘗試使用螞蟻從命令行建立在同一個項目時,出現以下輸出:在xxhdpi文件夾中出現Android ant build失敗

-build-setup: 
    [echo] Creating output directories if needed... 

-pre-build: 

-code-gen: 
    [echo] ---------- 
    [echo] Handling aidl files... 
    [aidl] No AIDL files to compile. 
    [echo] ---------- 
    [echo] Handling RenderScript files... 
[renderscript] No RenderScript files to compile. 
    [echo] ---------- 
    [echo] Handling Resources... 
    [aapt] Found Deleted Target File 
    [aapt] Generating resource IDs... 
    [aapt] invalid resource directory name: /data/project/res/drawable-xxhdpi 

BUILD FAILED 
/android-sdk-mac_x86/tools/ant/build.xml:485: The following error occurred while executing this line: 
/android-sdk-mac_x86/tools/ant/build.xml:560: The following error occurred while executing this line: 
/android-sdk-mac_x86/tools/ant/build.xml:589: null returned: 1 

這是我的理解是繪製-xxhdpi是支持的格式了,那麼,爲什麼在Eclipse但不是這方面的工作在螞蟻?

==編輯(添加我的project.properties文件)== 這是我的project.properties文件中有:

android.library.reference.1=resources/ 
android.library.reference.2=../promotion 
# Project target. 
target=android-8 
android.library.reference.3=resources/ 
android.library.reference.4=resources/ 
+2

我的猜測是:你在你的ant腳本中設置了錯誤的sdk目標。嘗試android更新項目,並給它正確的目標。 – Tim

+0

感謝Tim的建議。我已經爲項目和它的庫文件夾運行了android更新項目無濟於事。 – user1116933

+0

介意顯示你的project.properties? – Tim

回答

1

你已經在你的ant腳本/項目設置了錯誤的SDK目標的.properties。適用於Android 4.2的SDK版本爲17,您可以使用SDK版本8(即Android 2.2)進行編譯。

使用此更新項目:

的Android更新項目--target 正確的目標

您可以android list targets列出可用的目標。

或者只是更新您的project.properties並手動將SDK版本設置爲(你想編譯或任何Android SDK中)17:

target=android-17 
0

更新您的AAPT,我只是解決了這個問題。