使用Ant调试构建Android项目时出错

时间:2012-12-14 13:20:11

标签: android ant apk

在进行ant构建时,我正在进行

ERROR: Unknown option '--generate-dependencies'

项目仅包含由Android项目create命令创建的默认页面。

  admin$ export PATH=$PATH:/Users/admin/Downloads/adt-bundle-mac/sdk/platform-tools;export PATH=$PATH:/Users/admin/Downloads/adt-bundle-mac/sdk/tools;ant debug  
    Buildfile: /Applications/MAMP/htdocs/command_test/build.xml  

    -set-mode-check:  

    -set-debug-files:  

    -check-env:  
     [checkenv] Android SDK Tools Revision 21  
     [checkenv] Installed at /Users/admin/Downloads/adt-bundle-mac/sdk  

    -setup:  
         [echo] Project Name: command_test  
      [gettype] Project Type: Application  

    -set-debug-mode:  

    -debug-obfuscation-check:  

    -build-setup:  
         [echo] Resolving Build Target for command_test...  
    [gettarget] Project Target:   Android 2.2  
    [gettarget] API level:        8  
         [echo] ----------  
         [echo] Creating output directories if needed...  
         [echo] ----------  
         [echo] Resolving Dependencies for command_test...  
    [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  

    -pre-build:  

    -code-gen:  
    [mergemanifest] Merging AndroidManifest files into one.  
    [mergemanifest] Manifest merger disabled. Using project manifest only.  
         [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] Generating resource IDs...  
         [aapt] ERROR: Unknown option '--generate-dependencies'  
         [aapt] Android Asset Packaging Tool  
         [aapt]   
         [aapt] Usage:  
         [aapt]  aapt l[ist] [-v] [-a] file.{zip,jar,apk}  
         [aapt]    List contents of Zip-compatible archive.  
         [aapt]   
         [aapt]  aapt d[ump] [--values] WHAT file.{apk} [asset [asset ...]]  
         [aapt]    badging          Print the label and icon for the app declared in APK.  
         [aapt]    permissions      Print the permissions from the APK.  
         [aapt]    resources        Print the resource table from the APK.  
         [aapt]    configurations   Print the configurations in the APK.  
         [aapt]    xmltree          Print the compiled xmls in the given assets.  
         [aapt]    xmlstrings       Print the strings of the given compiled xml assets.  
         [aapt]   
         [aapt]  aapt p[ackage] [-d][-f][-m][-u][-v][-x][-z][-M AndroidManifest.xml] \  
         [aapt]         [-0 extension [-0 extension ...]] [-g tolerance] [-j jarfile] \  
         [aapt]         [--debug-mode] [--min-sdk-version VAL] [--target-sdk-version VAL] \  
         [aapt]         [--app-version VAL] [--app-version-name TEXT] [--custom-package VAL] \  
         [aapt]         [--rename-manifest-package PACKAGE] \  
         [aapt]         [--rename-instrumentation-target-package PACKAGE] \  
         [aapt]         [--utf16] [--auto-add-overlay] \  
         [aapt]         [--max-res-version VAL] \  
         [aapt]         [-I base-package [-I base-package ...]] \  
         [aapt]         [-A asset-source-dir]  [-G class-list-file] [-P public-definitions-file] \  
         [aapt]         [-S resource-sources [-S resource-sources ...]]         [-F apk-file] [-J R-file-dir] \  
         [aapt]         [--product product1,product2,...] \  
         [aapt]         [raw-files-dir [raw-files-dir] ...]  
         [aapt]   
         [aapt]    Package the android resources.  It will read assets and resources that are  
         [aapt]    supplied with the -M -A -S or raw-files-dir arguments.  The -J -P -F and -R  
         [aapt]    options control which files are output.  
         [aapt] 
         [aapt]  aapt r[emove] [-v] file.{zip,jar,apk} file1 [file2 ...]  
         [aapt]    Delete specified files from Zip-compatible archive.  
         [aapt]   
         [aapt]  aapt a[dd] [-v] file.{zip,jar,apk} file1 [file2 ...]  
         [aapt]    Add specified files to Zip-compatible archive.  
         [aapt]   
         [aapt]  aapt v[ersion]  
         [aapt]    Print program version.  
         [aapt]   
         [aapt]  Modifiers:  
         [aapt]    -a  print Android-specific data (resources, manifest) when listing  
         [aapt]    -c  specify which configurations to include.  The default is all  
         [aapt]        configurations.  The value of the parameter should be a comma  
         [aapt]        separated list of configuration values.  Locales should be specified  
         [aapt]        as either a language or language-region pair.  Some examples:  
         [aapt]             en  
         [aapt]             port,en  
         [aapt]             port,land,en_US  
         [aapt]        If you put the special locale, zz_ZZ on the list, it will perform  
         [aapt]        pseudolocalization on the default locale, modifying all of the  
         [aapt]        strings so you can look for strings that missed the  
         [aapt]        internationalization process.  For example:  
         [aapt]             port,land,zz_ZZ  
         [aapt]    -d  one or more device assets to include, separated by commas  
         [aapt]    -f  force overwrite of existing files  
         [aapt]    -g  specify a pixel tolerance to force images to grayscale, default 0  
         [aapt]    -j  specify a jar or zip file containing classes to include  
         [aapt]    -k  junk path of file(s) added  
         [aapt]    -m  make package directories under location specified by -J  
         [aapt]    -u  update existing packages (add new, replace older, remove deleted files)  
         [aapt]    -v  verbose output  
         [aapt]    -x  create extending (non-application) resource IDs  
         [aapt]    -z  require localization of resource attributes marked with  
         [aapt]        localization="suggested"  
         [aapt]    -A  additional directory in which to find raw asset files  
         [aapt]    -G  A file to output proguard options into.  
         [aapt]    -F  specify the apk file to output  
         [aapt]    -I  add an existing package to base include set  
         [aapt]    -J  specify where to output R.java resource constant definitions  
         [aapt]    -M  specify full path to AndroidManifest.xml to include in zip  
         [aapt]    -P  specify where to output public resource definitions  
         [aapt]    -S  directory in which to find resources.  Multiple directories will be   scanned  
         [aapt]        and the first match found (left to right) will take precedence.  
         [aapt]    -0  specifies an additional extension for which such files will not  
         [aapt]        be stored compressed in the .apk.  An empty string means to not  
         [aapt]        compress any files at all.  
         [aapt]    --debug-mode  
         [aapt]        inserts android:debuggable="true" in to the application node of the  
         [aapt]        manifest, making the application debuggable even on production devices.  
         [aapt]    --min-sdk-version  
         [aapt]        inserts android:minSdkVersion in to manifest.  If the version is 7 or  
         [aapt]        higher, the default encoding for resources will be in UTF-8.  
         [aapt]    --target-sdk-version  
         [aapt]        inserts android:targetSdkVersion in to manifest.  
         [aapt]    --max-res-version  
         [aapt]        ignores versioned resource directories above the given value.  
         [aapt]    --values  
         [aapt]        when used with "dump resources" also includes resource values.  
         [aapt]    --version-code  
         [aapt]        inserts android:versionCode in to manifest.  
         [aapt]    --version-name  
         [aapt]        inserts android:versionName in to manifest.  
         [aapt]    --custom-package  
         [aapt]        generates R.java into a different package.  
         [aapt]    --auto-add-overlay  
         [aapt]        Automatically add resources that are only in overlays.  
         [aapt]    --rename-manifest-package  
         [aapt]        Rewrite the manifest so that its package name is the package name  
         [aapt]        given here.  Relative class names (for example .Foo) will be  
         [aapt]        changed to absolute names with the old package so that the code  
         [aapt]        does not need to change.  
         [aapt]    --rename-instrumentation-target-package  
         [aapt]        Rewrite the manifest so that all of its instrumentation  
         [aapt]        components target the given package.  Useful when used in  
         [aapt]        conjunction with --rename-manifest-package to fix tests against  
         [aapt]        a package that has been renamed.  
         [aapt]    --product  
         [aapt]        Specifies which variant to choose for strings that have  
         [aapt]        product variants  
         [aapt]    --utf16  
         [aapt]        changes default encoding for resources to UTF-16.  Only useful when API  
         [aapt]        level is set to 7 or higher where the default encoding is UTF-8.  
         [aapt]    --non-constant-id  
         [aapt]        Make the resources ID non constant. This is required to make an R java   class  
         [aapt]        that does not contain the final value but is used to make reusable   compiled  
         [aapt]        libraries that need to access resources.  

    BUILD FAILED  
    /Users/admin/Downloads/adt-bundle-mac/sdk/tools/ant/build.xml:645: The following error occurred while executing this line:  
    /Users/admin/Downloads/adt-bundle-mac/sdk/tools/ant/build.xml:683: null returned: 2  

0 个答案:

没有答案