cordova build ant error build.xml

时间:2014-08-29 17:44:36

标签: cordova ant build

“cordova build”后出现以下错误

BUILD FAILED
/Users/mboeckle/Android/adt-bundle-mac-x86_64-20130219/sdk/tools/ant/build.xml:892: The following error occurred while executing this line:
/Users/mboeckle/Android/adt-bundle-mac-x86_64-20130219/sdk/tools/ant/build.xml:894: The following error occurred while executing this line:
/Users/mboeckle/Android/adt-bundle-mac-x86_64-20130219/sdk/tools/ant/build.xml:906: The following error occurred while executing this line:
/Users/mboeckle/Android/adt-bundle-mac-x86_64-20130219/sdk/tools/ant/build.xml:283: null returned: 2

Total time: 3 seconds
Error code 1 for command: ant with args: debug,-f,/Users/mboeckle/Desktop/fashionista/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: /Users/mboeckle/Desktop/fashionista/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)

build.xml中的错误出现在以下区域:

<!-- Converts this project's .class files into .dex files -->
<target name="-dex" depends="-compile, -post-compile, -obfuscate">
    <do-only-if-manifest-hasCode elseText="hasCode = false. Skipping...">
        <!-- only convert to dalvik bytecode is *not* a library -->
        <do-only-if-not-library elseText="Library project: do not convert bytecode..." >
            <!-- special case for instrumented builds: need to use no-locals and need
                 to pass in the emma jar. -->
            <if condition="${build.is.instrumented}">
                <then>
                    <dex-helper nolocals="true">
                        <external-libs>
                            <fileset file="${emma.dir}/emma_device.jar" />
                        </external-libs>
                    </dex-helper>
                </then>
                <else>
                    <dex-helper />
                </else>
            </if>
        </do-only-if-not-library>
    </do-only-if-manifest-hasCode>
</target>

更新:

-dex:
  [dex] input: /Users/mboeckle/Desktop/fashionista/platforms/android/ant-build/classes
  [dex] input: /Users/mboeckle/Desktop/fashionista/platforms/android/CordovaLib/ant-build/classes.jar
  [dex] input: /Users/mboeckle/Desktop/fashionista/platforms/android/libs/cordova-3.6.0-dev.jar
  [dex] Using Pre-Dexed classes-a6c0218dd60ae2a0a1a01e2e8cd6990f.jar <- /Users/mboeckle/Desktop/fashionista/platforms/android/CordovaLib/ant-build/classes.jar
  [dex] Using Pre-Dexed cordova-3.6.0-dev-c2a14019ea9cd5796f0714685a70533a.jar <- /Users/mboeckle/Desktop/fashionista/platforms/android/libs/cordova-3.6.0-dev.jar
  [dex] Found modified input file
  [dex] Converting compiled files and external libraries into /Users/mboeckle/Desktop/fashionista/platforms/android/ant-build/classes.dex...
   [dx] Merged dex A (7 defs/2.2KiB) with dex B (207 defs/313.8KiB). Result is 214 defs/385.0KiB. Took 0.3s
   [dx] 
   [dx] UNEXPECTED TOP-LEVEL EXCEPTION:
   [dx] com.android.dex.DexException: Multiple dex files define Lcom/squareup/okhttp/Address;
   [dx]     at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)
   [dx]     at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
   [dx]     at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)
   [dx]     at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
   [dx]     at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
   [dx]     at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
   [dx]     at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
   [dx]     at com.android.dx.command.dexer.Main.run(Main.java:230)
   [dx]     at com.android.dx.command.dexer.Main.main(Main.java:199)
   [dx]     at com.android.dx.command.Main.main(Main.java:103)
   [dx] 

任何想法?清单有问题吗?如果我在Eclipse中编译它可以正常工作。

最好的

中号

0 个答案:

没有答案