title: Ionic Build Error: :mergeDebugAssets Could not merge source set folders
body: <p>I am getting this error whenever I am trying to run "ionic build android", the build process runs half the way and shows error after this line: </p>
  
  <pre><code>:mergeDebugAssets
  Could not merge source set folders: 
  </code></pre>
  
  <p>I have tried all the available answers in last 24 hrs but nothing worked, I am started to get this error after updating JDK to latest version, </p>
  
  <p>I have tried these so far.
  Updated Android SDK, removed Android platform and added it back, updated android platform to  android@6.2.2, removed all the dev dependencies form package.json file tried to replace tools folder from Android SDK, but nothing worked.
  My ionic info
  Your system information:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Below is the big error log,</p>
  
  <pre><code>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'.
      &gt; [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.
  </code></pre>
  
  <p>Full error log is very big please check <a href="https://docs.google.com/document/d/1BHJ8vtKhO6dnfVM5qXxUBtjAnQSX2NyJp0GdeVwtuMQ/edit?usp=sharing" rel="nofollow noreferrer">here</a></p>