0

我通过编译android项目"ant debug"。(http://developer.android.com/training/basics/firstapp/starting-activity.html)**

...
-build-setup:
     [echo] Resolving Build Target for MyFirstApp...
[gettarget] Project Target:   Android 2.3.3
[gettarget] API level:        10
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: D:\myproj\android\MyFirstApp\bin
    [mkdir] Created dir: D:\myproj\android\MyFirstApp\bin\res
    [mkdir] Created dir: D:\myproj\android\MyFirstApp\gen
    [mkdir] Created dir: D:\myproj\android\MyFirstApp\bin\classes
    [mkdir] Created dir: D:\myproj\android\MyFirstApp\bin\dexedLibs
     [echo] ----------
     [echo] Resolving Dependencies for MyFirstApp...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[dependency] API<=15: Adding annotations.jar to the classpath.
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

我在 ${sdk}\tools\support 下找到了 annotations.jar,并在 ${sdk}\tools\ant\build.xml 下面跟踪了 build.xml

<echo level="info">Resolving Dependencies for ${ant.project.name}...</echo>
        <dependency
                libraryFolderPathOut="project.library.folder.path"
                libraryPackagesOut="project.library.packages"
                libraryManifestFilePathOut="project.library.manifest.file.path"
                libraryResFolderPathOut="project.library.res.folder.path"
                libraryBinAidlFolderPathOut="project.library.bin.aidl.folder.path"
                libraryRFilePathOut="project.library.bin.r.file.path"
                libraryNativeFolderPathOut="project.library.native.folder.path"
                jarLibraryPathOut="project.all.jars.path"
                targetApi="${project.target.apilevel}"
                verbose="${verbose}" />

如何将 annotation.jar 添加到 CLASSPATH?PS:我已经在下添加annontation.jarD:\myproj\android\MyFirstApp\libs,但仍然报告该消息。

4

1 回答 1

0

在您的 Android 清单 xml 中更改它需要 API 级别 15 的最低 SDK 版本

<uses-sdk
        android:minSdkVersion="10"
 />

<uses-sdk
        android:minSdkVersion="15"
/>

因为依赖是 API 级别 15

于 2013-01-31T13:09:32.343 回答