Phonegap错误:任务':app:transformDexArchiveWithDexMergerForDebug'的执行失败

时间:2019-03-27 18:06:46

标签: cordova gradle phonegap

我刚刚格式化了计算机,现在我无法运行了,

phonegap run android 

输出结果:

Subproject Path: CordovaLib


Subproject Path: app

publishNonDefault is deprecated and has no effect anymore. All variants are now published.


The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
    at build_6jtmpypmioylbnkss15beh0o6.run(/opt/container/folder/www/app.myApplication/platforms/android/app/build.gradle:148)

Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.

:CordovaLib:preBuild UP-TO-DATE

:CordovaLib:preDebugBuild UP-TO-DATE


:CordovaLib:compileDebugAidl UP-TO-DATE

:CordovaLib:compileDebugRenderscript 
UP-TO-DATE
:CordovaLib:checkDebugManifest UP-TO-DATE

:CordovaLib:generateDebugBuildConfig

UP-TO-DATE

:CordovaLib:prepareLintJar 
UP-TO-DATE

:CordovaLib:generateDebugResValues

UP-TO-DATE


:CordovaLib:generateDebugResources

UP-TO-DATE


:CordovaLib:packageDebugResources

UP-TO-DATE


:CordovaLib:platformAttrExtractor

UP-TO-DATE


:CordovaLib:processDebugManifest
 UP-TO-DATE
:CordovaLib:processDebugResources

UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE

:CordovaLib:javaPreCompileDebug

UP-TO-DATE

:CordovaLib:compileDebugJavaWithJavac 
UP-TO-DATE

:CordovaLib:processDebugJavaRes

NO-SOURCE

:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
 UP-TO-DATE

:app:preBuild UP-TO-DATE
:app:preDebugBuild
 UP-TO-DATE
:app:compileDebugAidl
 UP-TO-DATE
:CordovaLib:packageDebugRenderscript NO-SOURCE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE

:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
 UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResources
 UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:javaPreCompileDebug
 UP-TO-DATE
:app:compileDebugJavaWithJavac
 UP-TO-DATE
:app:compileDebugNdk NO-SOURCE
:app:compileDebugSources UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE

:CordovaLib:mergeDebugAssets UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
 UP-TO-DATE
:app:transformClassesWithStackFramesFixerForDebug
 UP-TO-DATE

:app:transformClassesWithDesugarForDebug UP-TO-DATE
:app:transformClassesWithDexBuilderForDebug
 UP-TO-DATE
:app:transformDexArchiveWithExternalLibsDexMergerForDebug UP-TO-DATE
:app:transformDexArchiveWithDexMergerForDebug
Dex: Error converting bytecode to dex:

Cause: com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;
    UNEXPECTED TOP-LEVEL EXCEPTION:
    com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;

com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
    at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
    at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
    at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
> com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

 FAILED
38 actionable tasks: 1 executed, 37 up-to-date

/opt/container/folder/www/app.myApplication/platforms/android/gradlew: Command failed with exit code 1 Error output:
Dex: Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;
    UNEXPECTED TOP-LEVEL EXCEPTION:
    com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;

com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
    at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
    at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
    at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
> com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

任何想法如何解决? ps:我刚刚安装了gradle(因为我的计算机已格式化)。

0 个答案:

没有答案