2

我是 android 开发的新手,所以我尝试了 android.com 上的第一个教程。我想为我的 HTC 英雄编写的应用程序有 android 2.1 eclair。所以我做了一个新项目:

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 debug。结果:

-构建设置:

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
4

1 回答 1

1

已解决:我需要更仔细地选择目标。它针对特定安装的 android 版本。键入 android 列表目标以获取更多信息

于 2012-12-04T16:44:59.137 回答