使用ant生成classes.dex时出错



我只是简单地使用创建了我的android项目

android create project -n MyApps -t 3 -p "./" --package com.ith -a MyAppActivity

所有必要的文件都已创建,但当我尝试使用构建时

ant release

命令我收到以下错误

-dex:
      [dex] Converting compiled files and external libraries into D:OfficeMy A
ppsbinclasses.dex...
       [dx] unknown option: --output
       [dx] usage:
       [dx]   dx --dex [--debug] [--verbose] [--positions=<style>] [--no-locals]
       [dx]   [--no-optimize] [--statistics] [--[no-]optimize-list=<file>] [--no
-strict]
       [dx]   [--keep-classes] [--output=<file>] [--dump-to=<file>] [--dump-widt
h=<n>]
       [dx]   [--dump-method=<name>[*]] [--verbose-dump] [--no-files] [--core-li
brary]
       [dx]   [--num-threads=<n>] [<file>.class | <file>.{zip,jar,apk} | <direct
ory>] ...
       [dx]     Convert a set of classfiles into a dex file, optionally embedded
 in a
       [dx]     jar/zip. Output name must end with one of: .dex .jar .zip .apk.
Positions
       [dx]     options: none, important, lines.
       [dx]   dx --annotool --annotation=<class> [--element=<element types>]
       [dx]   [--print=<print types>]
       [dx]   dx --dump [--debug] [--strict] [--bytes] [--optimize]
       [dx]   [--basic-blocks | --rop-blocks | --ssa-blocks | --dot] [--ssa-step
=<step>]
       [dx]   [--width=<n>] [<file>.class | <file>.txt] ...
       [dx]     Dump classfiles, or transformations thereof, in a human-oriented
 format.
       [dx]   dx --junit [-wait] <TestClass>
       [dx]     Run the indicated unit test.
       [dx]   dx -J<option> ... <arguments, in one of the above forms>
       [dx]     Pass VM-specific options to the virtual machine that runs dx.
       [dx]   dx --version
       [dx]     Print the version of this tool (1.6).
       [dx]   dx --help
       [dx]     Print this message.
BUILD FAILED
C:Program FilesEclipse-sdkandroid-sdktoolsantbuild.xml:729: The following
error occurred while executing this line:
C:Program FilesEclipse-sdkandroid-sdktoolsantbuild.xml:731: The following
error occurred while executing this line:
C:Program FilesEclipse-sdkandroid-sdktoolsantbuild.xml:743: The following
error occurred while executing this line:
C:Program FilesEclipse-sdkandroid-sdktoolsantbuild.xml:249: null returned:
 1

我还没有编辑我的build.xml文件,主规则build.xml文件在C:Program FilesEclipse-sdkandroid-sdktoolsantbuild.xml中。主要规则是build.xml

我如何修复这个错误

您使用该命令创建项目android create project ...,可以在您的项目中创建build.xml,我认为您不需要修改它,它工作正常。

使用android sdk管理器更新android-toolsandroid-platform-tools

好的,我在的帮助下修复了它http://brettsdevblog.blogspot.com/2011/10/android-sdk-revision-13-pain.html这都是android平台工具的问题,本应更新

相关内容

  • 没有找到相关文章