对于 Android 中的代码混淆,当我给出命令“ant release”时,我收到以下错误: 。我到处搜索但找不到解决方案

发布于 2024-12-23 06:19:48 字数 3667 浏览 3 评论 0原文

Buildfile: C:\Users\**\workspace\Obfuscation\build.xml

-set-mode-check:

-set-release-mode:

-release-obfuscation-check:

-setup:
     [echo] Gathering info for Obfuscation...
    [setup] Android SDK Tools Revision 15
    [setup] Project Target: Android 2.2
    [setup] API level: 8
    [setup]
    [setup] ------------------
    [setup] Resolving library dependencies:
    [setup] No library dependencies.
    [setup]
    [setup] ------------------
    [setup]

-build-setup:
     [echo] Creating output directories if needed...
    [mkdir] Created dir: C:\**\**\workspace\Obfuscation\libs

-pre-build:

-code-gen:
     [echo] ----------
     [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...

-pre-compile:

-compile:
    [javac] C:\Program Files\Eclipse-sdk\android-sdk\tools\ant\build.xml:600: wa
rning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; s
et to false for repeatable builds
    [javac] Compiling 1 source file to C:\Users\**\workspace\Obfuscation
\bin\classes

-post-compile:

-obfuscate:

-dex:
      [dex] Converting compiled files and external libraries into C:\Users\**
ndhar\workspace\Obfuscation\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 tran
       [dx] sformations 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

Total time: 3 seconds

我使用 android 更新项目更新了项目,当我命令“ant clean”时,构建成功,但当我继续命令“ant release”时,会显示上述失败消息。我正在使用 apache-ant-1.8.2

Buildfile: C:\Users\**\workspace\Obfuscation\build.xml

-set-mode-check:

-set-release-mode:

-release-obfuscation-check:

-setup:
     [echo] Gathering info for Obfuscation...
    [setup] Android SDK Tools Revision 15
    [setup] Project Target: Android 2.2
    [setup] API level: 8
    [setup]
    [setup] ------------------
    [setup] Resolving library dependencies:
    [setup] No library dependencies.
    [setup]
    [setup] ------------------
    [setup]

-build-setup:
     [echo] Creating output directories if needed...
    [mkdir] Created dir: C:\**\**\workspace\Obfuscation\libs

-pre-build:

-code-gen:
     [echo] ----------
     [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...

-pre-compile:

-compile:
    [javac] C:\Program Files\Eclipse-sdk\android-sdk\tools\ant\build.xml:600: wa
rning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; s
et to false for repeatable builds
    [javac] Compiling 1 source file to C:\Users\**\workspace\Obfuscation
\bin\classes

-post-compile:

-obfuscate:

-dex:
      [dex] Converting compiled files and external libraries into C:\Users\**
ndhar\workspace\Obfuscation\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 tran
       [dx] sformations 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

Total time: 3 seconds

I updated the project using android update project and when i command "ant clean" the build is successful but as i step forward to command "ant release" the above failed message shows up. I am using apache-ant-1.8.2

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

归途 2024-12-30 06:19:48

问题就出在这里:

-dex:

 [dex] 正在将编译文件和外部库转换为 C:\Users\smanandhar\workspace\Obfuscation\bin\classes.dex...
   [dx] 未知选项:--output

构建文件的 dex 目标使用无效参数调用 dx 命令。

这将引导您这个问题< /a>,给出解决方案的方向

The problem lies here:

-dex:

  [dex] Converting compiled files and external libraries into C:\Users\smanandhar\workspace\Obfuscation\bin\classes.dex...
   [dx] unknown option: --output

The dex target of your build file invokes dx command with an invalid parameter.

This leads you to this SO question, which gives the directions to the solution

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文