每当我尝试运行" ionic build android"时,我都会收到此错误,构建过程运行一半并在此行后显示错误:
:mergeDebugAssets
Could not merge source set folders:
我在过去24小时内尝试了所有可用的答案,但没有任何效果,我在将JDK更新到最新版本后开始出现此错误,
到目前为止,我已尝试过这些。 更新了Android SDK,删除了Android平台并将其添加回来,更新了android平台到android@6.2.2,删除了所有dev依赖关系表单package.json文件试图从Android SDK替换工具文件夹,但没有任何效果。 我的离子信息 您的系统信息:
Cordova CLI: 6.5.0
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
ios-deploy version: 1.9.0
ios-sim version: 5.0.10
OS: macOS Sierra
Node Version: v6.11.0
Xcode version: Xcode 8.3.3 Build version 8E3004b
以下是大错误日志,
add to body class: platform-android
ANDROID_HOME=/Users/amitabhs/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_141.jdk/Contents/Home
:wrapper
BUILD SUCCESSFUL
Total time: 1.744 secs
Subproject Path: CordovaLib
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_7w3ckihviy9j3ktiflnuopmyu.run(/Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/build.gradle:138)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental Java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild
UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preReleaseBuild
UP-TO-DATE
:CordovaLib:preBuild
UP-TO-DATE
:CordovaLib:preDebugBuild
UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugNdk
UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint
UP-TO-DATE
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript
UP-TO-DATE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes
UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:CordovaLib:preReleaseBuild
UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl
:CordovaLib:compileReleaseNdk
UP-TO-DATE
:CordovaLib:copyReleaseLint
UP-TO-DATE
:CordovaLib:mergeReleaseShaders
:CordovaLib:compileReleaseShaders
:CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets
:CordovaLib:mergeReleaseProguardFiles
:CordovaLib:packageReleaseRenderscript
UP-TO-DATE
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:processReleaseManifest
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:processReleaseResources
:CordovaLib:generateReleaseSources
:CordovaLib:incrementalReleaseJavaCompilationSafeguard
:CordovaLib:compileReleaseJavaWithJavac
:CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processReleaseJavaRes
UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareComAndroidSupportSupportV132340Library
:prepareComAndroidSupportSupportV42400Library
:prepareComGoogleAndroidGmsPlayServicesBase980Library
:prepareComGoogleAndroidGmsPlayServicesBasement980Library
:prepareComGoogleAndroidGmsPlayServicesGcm980Library
:prepareComGoogleAndroidGmsPlayServicesIid980Library
:prepareComGoogleAndroidGmsPlayServicesTasks980Library
:prepareMeLeolinShortcutBadger114Library
:prepareOrgApacheCordovaCordovaLib622DebugLibrary
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:incrementalDebugJavaCompilationSafeguard
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:compileDebugNdk
UP-TO-DATE
:compileDebugSources
:mergeDebugShaders
:compileDebugShaders
:generateDebugAssets
:mergeDebugAssets
Could not merge source set folders:
* What went wrong:
Execution failed for task ':mergeDebugAssets'.
> [www/lib/angularjs-slider/node_modules/semver/semver.browser.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/angularjs-slider/node_modules/semver/semver.browser.js [www/lib/angularjs-slider/node_modules/semver/semver.browser.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/angularjs-slider/node_modules/semver/semver.browser.js.gz: Error: Duplicate resources
[www/lib/ion-autocomplete/node_modules/bower/lib/node_modules/semver/semver.browser.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ion-autocomplete/node_modules/bower/lib/node_modules/semver/semver.browser.js [www/lib/ion-autocomplete/node_modules/bower/lib/node_modules/semver/semver.browser.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ion-autocomplete/node_modules/bower/lib/node_modules/semver/semver.browser.js.gz: Error: Duplicate resources
[www/lib/ion-autocomplete/node_modules/bower/lib/node_modules/semver/semver.min.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ion-autocomplete/node_modules/bower/lib/node_modules/semver/semver.min.js [www/lib/ion-autocomplete/node_modules/bower/lib/node_modules/semver/semver.min.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ion-autocomplete/node_modules/bower/lib/node_modules/semver/semver.min.js.gz: Error: Duplicate resources
[www/lib/underscore/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/underscore/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar [www/lib/underscore/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/underscore/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar.gz: Error: Duplicate resources
[www/lib/ion-autocomplete/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ion-autocomplete/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar [www/lib/ion-autocomplete/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ion-autocomplete/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar.gz: Error: Duplicate resources
[www/lib/angularjs-slider/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/angularjs-slider/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar [www/lib/angularjs-slider/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/angularjs-slider/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar.gz: Error: Duplicate resources
[www/lib/fingerprintjs2/node_modules/semver/semver.min.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/fingerprintjs2/node_modules/semver/semver.min.js [www/lib/fingerprintjs2/node_modules/semver/semver.min.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/fingerprintjs2/node_modules/semver/semver.min.js.gz: Error: Duplicate resources
[www/lib/ngCordova/node_modules/semver/semver.browser.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ngCordova/node_modules/semver/semver.browser.js [www/lib/ngCordova/node_modules/semver/semver.browser.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ngCordova/node_modules/semver/semver.browser.js.gz: Error: Duplicate resources
[www/lib/fingerprintjs2/node_modules/semver/semver.browser.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/fingerprintjs2/node_modules/semver/semver.browser.js [www/lib/fingerprintjs2/node_modules/semver/semver.browser.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/fingerprintjs2/node_modules/semver/semver.browser.js.gz: Error: Duplicate resources
[www/lib/angularjs-slider/node_modules/semver/semver.min.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/angularjs-slider/node_modules/semver/semver.min.js [www/lib/angularjs-slider/node_modules/semver/semver.min.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/angularjs-slider/node_modules/semver/semver.min.js.gz: Error: Duplicate resources
[www/lib/underscore/node_modules/semver/semver.browser.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/underscore/node_modules/semver/semver.browser.js [www/lib/underscore/node_modules/semver/semver.browser.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/underscore/node_modules/semver/semver.browser.js.gz: Error: Duplicate resources
[www/lib/ion-autocomplete/node_modules/log4js/node_modules/semver/semver.browser.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/asse
ts/www/lib/ion-autocomplete/node_modules/log4js/node_modules/semver/semver.browser.js [www/lib/ion-autocomplete/node_modules/log4js/node_modules/semver/semver.browser.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ion-autocomplete/node_modules/log4js/node_modules/semver/semver.browser.js.gz: Error: Duplicate resources
[www/lib/ngCordova/node_modules/semver/semver.min.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ngCordova/node_modules/semver/semver.min.js [www/lib/ngCordova/node_modules/semver/semver.min.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ngCordova/node_modules/semver/semver.min.js.gz: Error: Duplicate resources
[www/lib/ngCordova/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ngCordova/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar [www/lib/ngCordova/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ngCordova/node_modules/fsevents/node_modules/tar-pack/test/fixtures/packed.tar.gz: Error: Duplicate resources
[www/lib/underscore/node_modules/semver/semver.min.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/underscore/node_modules/semver/semver.min.js [www/lib/underscore/node_modules/semver/semver.min.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/underscore/node_modules/semver/semver.min.js.gz: Error: Duplicate resources
[www/lib/ion-autocomplete/node_modules/log4js/node_modules/semver/semver.min.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ion-autocomplete/node_modules/log4js/node_modules/semver/semver.min.js [www/lib/ion-autocomplete/node_modules/log4js/node_modules/semver/semver.min.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ion-autocomplete/node_modules/log4js/node_modules/semver/semver.min.js.gz: Error: Duplicate resources
[www/lib/ionic-ratings/node_modules/semver/semver.browser.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ionic-ratings/node_modules/semver/semver.browser.js [www/lib/ionic-ratings/node_modules/semver/semver.browser.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ionic-ratings/node_modules/semver/semver.browser.js.gz: Error: Duplicate resources
[www/lib/ionic-ratings/node_modules/semver/semver.min.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ionic-ratings/node_modules/semver/semver.min.js [www/lib/ionic-ratings/node_modules/semver/semver.min.js] /Users/amitabhs/Projects/Kudaap/KudaapCourts/Mobile/KudappIonic_Courts/platforms/android/assets/www/lib/ionic-ratings/node_modules/semver/semver.min.js.gz: Error: Duplicate resources
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
完整错误日志非常大请检查here
答案 0 :(得分:0)
解决方法是删除semver目录。
答案 1 :(得分:0)
要解决此问题,我从项目中删除了semver.min.js.gz和semver.browser.js.gz的所有实例。