2012-12-04 111 views
2

我是新的android開發,所以我嘗試了android.com上的第一個教程。我想爲我的HTC英雄寫的應用程序有android 2.1 eclair。所以我做了一個新的項目有:螞蟻調試issueandroid應用程序

minimum sdk 2.0 eclair (API 5) <br> 
target sdk 2.1 eclair (API 7) <br> 
compile sdk 2.1  (API 7) 

我用命令android做出的build.xml:

android update project --name MyFirstApp -- target 1 --path workspace\MyFirstApp 

然後我去項目的根文件夾,然後運行ant調試。結果:

-build設置:

Project target: Android 1.5     (que? I clearly configured 2.1, didn't I?) <br> 
API level: 3 
WARNING: Attribute minSdkVersion in AndroidManifest.xml(5) is higher than the project target API level(3) <br> 

This warning would make sense if my target API was indeed API 3. This is definitly not the case since I clearly configured API 5 in eclipse. <br> 
Ant continues and at the end, these errors kill it: 

[aapt] C:\...\workspace\MyFirstApp\bin\AndroidManifest.xml:7: error: No resource found for attribute 'targetSdkVersion' in package 'android' <br> 
[aapt] C:\...\workspace\MyFirstApp\bin\AndroidManifest.xml:7: error: No resource found for attribute 'allowBackup' in package 'android' 

BUILD FAILED <br> 
C:Program Files\eclipse\Android SDK\tools\ant\build.xml:645: The following error occurred while executing this line: <br> 
C:Program Files\eclipse\Android SDK\tools\ant\build.xml:683: null returned: 1 

回答

1

解決:我需要多一點謹慎地選擇我的目標。它針對特定安裝的Android版本。鍵入android列表目標以獲取更多信息