0

尝试使用 ant 构建 android 项目时失败。该项目依赖于一个库,而该库依赖于 google play 服务。运行 ant release 后,出现以下错误:

[dex] Pre-Dexing D:\test\worskpace\MyAndroidLib\bin\classes.jar -> classes-ce7b0321dd8cbfdf7456c686f66a4bff.jar
[dx] The system cannot find the path specified.
[dx] The system cannot find the path specified.
[dx] The system cannot find the path specified.

如果我运行 android.bat,我还会收到 3 次“系统找不到指定的路径”。奇怪的是昨天它起作用了。

我构建了一个 hello world 应用程序,这是 cmd 的输出:

            D:\>cd D:\WORK\TEST\workspace11.4\TestApp

            D:\WORK\TEST\workspace11.4\TestApp>android update project --path .
            The system cannot find the path specified.
            The system cannot find the path specified.
            The system cannot find the path specified.
            Updated local.properties
            Updated file D:\WORK\TEST\workspace11.4\TestApp\proguard-project.txt

            D:\WORK\TEST\workspace11.4\TestApp>ant clean
            Buildfile: D:\WORK\TEST\workspace11.4\TestApp\build.xml

            -check-env:
             [checkenv] Android SDK Tools Revision 22.2.1
             [checkenv] Installed at C:\Program Files (x86)\Android\android-sdk

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

            -pre-clean:

            clean:
            [getlibpath] Library dependencies:
            [getlibpath] No Libraries
               [subant] No sub-builds to iterate on

            BUILD SUCCESSFUL
            Total time: 0 seconds

            D:\WORK\TEST\workspace11.4\TestApp>ant release
            Buildfile: D:\WORK\TEST\workspace11.4\TestApp\build.xml

            -set-mode-check:

            -set-release-mode:

            -release-obfuscation-check:
                 [echo] proguard.config is ${proguard.config}

            -pre-build:

            -check-env:
             [checkenv] Android SDK Tools Revision 22.2.1
             [checkenv] Installed at C:\Program Files (x86)\Android\android-sdk

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

            -build-setup:
            [getbuildtools] Using latest Build Tools: 18.1.0
                 [echo] Resolving Build Target for MainActivity...
            [gettarget] Project Target:   Android 4.3
            [gettarget] API level:        18
                 [echo] ----------
                 [echo] Creating output directories if needed...
                [mkdir] Created dir: D:\WORK\TEST\workspace11.4\TestApp\bin
                [mkdir] Created dir: D:\WORK\TEST\workspace11.4\TestApp\bin\res
                [mkdir] Created dir: D:\WORK\TEST\workspace11.4\TestApp\bin\rsObj
                [mkdir] Created dir: D:\WORK\TEST\workspace11.4\TestApp\bin\rsLibs
                [mkdir] Created dir: D:\WORK\TEST\workspace11.4\TestApp\gen
                [mkdir] Created dir: D:\WORK\TEST\workspace11.4\TestApp\bin\classes
                [mkdir] Created dir: D:\WORK\TEST\workspace11.4\TestApp\bin\dexedLibs
                 [echo] ----------
                 [echo] Resolving Dependencies for MainActivity...
            [dependency] Library dependencies:
            [dependency] No Libraries
            [dependency]
            [dependency] ------------------
                 [echo] ----------
                 [echo] Building Libraries with 'release'...
               [subant] No sub-builds to iterate on

            -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...
                 [echo] ----------
                 [echo] Handling Resources...
                 [aapt] Generating resource IDs...
                 [echo] ----------
                 [echo] Handling BuildConfig class...
            [buildconfig] Generating BuildConfig class.

            -pre-compile:

            -compile:
                [javac] Compiling 3 source files to D:\WORK\TEST\workspace11.4\TestApp\bin\c
            lasses

            -post-compile:

            -obfuscate:

            -dex:
                  [dex] input: D:\WORK\TEST\workspace11.4\TestApp\bin\classes
                  [dex] input: D:\WORK\TEST\workspace11.4\TestApp\libs\android-support-v4.ja
            r
                  [dex] Pre-Dexing D:\WORK\TEST\workspace11.4\TestApp\libs\android-support-v
            4.jar -> android-support-v4-8e9e420982613f1e6fa190e136da6f5a.jar
                   [dx] The system cannot find the path specified.
                   [dx] The system cannot find the path specified.
                   [dx] The system cannot find the path specified.

            BUILD FAILED
            C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:892: The followin
            g error occurred while executing this line:
            C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:894: The followin
            g error occurred while executing this line:
            C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:906: The followin
            g error occurred while executing this line:
            C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:284: null returne
            d: 1

            Total time: 6 seconds

            D:\WORK\TEST\workspace11.4\TestApp>
4

0 回答 0