$ cordova run android Android Studio project detected CHCP plugin after prepare hook: config-file set to http://.../chcp.json ANDROID_HOME=/.../Library/Android/sdk JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home studio Subproject Path: CordovaLib Subproject Path: app publishNonDefault is deprecated and has no effect anymore. All variants are now published. Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. 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_7iqq3l05h5ir45unzxq8vzck8.run(/.../platforms/android/app/build.gradle:145) :CordovaLib:preBuild UP-TO-DATE …… :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. > java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex * 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 38 actionable tasks: 1 executed, 37 up-to-date (node:8775) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /.../platforms/android/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. > java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex * 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
下面的命令也許能夠治好:html
$ cordova clean
參考:java
https://cordova.apache.org/docs/en/latest/reference/cordova-cli/index.html#cordova-clean-commandnode