使用ant制作classes.dex时出错

时间:2012-01-18 07:26:14

标签: android ant dex android-build

我只是使用

创建了我的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:\Office\My A
pps\bin\classes.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 Files\Eclipse-sdk\android-sdk\tools\ant\build.xml:729: The following
error occurred while executing this line:
C:\Program Files\Eclipse-sdk\android-sdk\tools\ant\build.xml:731: The following
error occurred while executing this line:
C:\Program Files\Eclipse-sdk\android-sdk\tools\ant\build.xml:743: The following
error occurred while executing this line:
C:\Program Files\Eclipse-sdk\android-sdk\tools\ant\build.xml:249: null returned:
 1

我没有编辑我的build.xml文件,主要规则build.xml文件位于C:\Program Files\Eclipse-sdk\android-sdk\tools\ant\build.xml。主要规则是build.xml

我该如何解决此错误

3 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分:0)

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

答案 2 :(得分:0)

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