title: Cordova Android project fails compile with duplicate google/gms
body: <p>A previously good cordova app is now failing compile with the following error and variations (always duplicate entries of com/google/android/gms/ ... something...)</p>
  
  <pre><code>    :app:transformClassesWithJarMergingForRelease FAILED
  
       FAILURE: Build failed with an exception.
  
       * What went wrong: Execution failed for task 
   ':app:transformClassesWithJarMergingForRelease'.
      com.android.build.api.transform.TransformException: java.util.zip.
    ZipException: duplicate entry:
       com/google/android/gms/tagmanager/Container$FunctionCallMacroCallback.class
  </code></pre>
  
  <p>I've looked at many many other cases here at Stackoverflow of similar errors, and applied solutions that have worked for others: </p>
  
  <ul>
  <li>I've installed the plugin "cordova-android-support-gradle-release 2.0.1" and set it to match the android support v4 version:</li>
  </ul>
  
  <blockquote>
  <pre><code>&lt;plugin name="cordova-android-support-gradle-release" spec="^2.0.1"&gt;
      &lt;variable name="ANDROID_SUPPORT_VERSION" value="24.1.1" /&gt;
  </code></pre>
  </blockquote>
  
  <ul>
  <li>I've examined the app and android build.gradle files for duplicate compiles of google services. There's only one: </li>
  </ul>
  
  <blockquote>
  <pre><code>dependencies {
      implementation fileTree(dir: 'libs', include: '*.jar')
      // SUB-PROJECT DEPENDENCIES START
      implementation(project(path: ":CordovaLib"))
      compile "com.google.android.gms:play-services-analytics:11.0.1"
      compile "com.android.support:support-v4:24.1.1+"
      // SUB-PROJECT DEPENDENCIES END
  }
  </code></pre>
  </blockquote>
  
  <ul>
  <li>I've run Cordova Clean</li>
  <li>I've removed the android platform and reinstalled</li>
  <li>I've compiled with the cordova command line build</li>
  <li>I've synched and compiled with the latest Android Studio version</li>
  <li>I've synched and compiled with the last Android Studio version that it compiled under, preview 3.2</li>
  <li>I've added the following to the app's build.gradle defaultConfig block:</li>
  </ul>
  
  <blockquote>
  <pre><code>    minSdkVersion 19
      targetSdkVersion 28
      multiDexEnabled true
  </code></pre>
  </blockquote>
  
  <ul>
  <li>I've updated all my plugins: </li>
  </ul>
  
  <blockquote>
  <pre><code>cordova-launch-review 2.0.2 "Launch Review"
  cordova-plugin-compat 1.2.0 "Compat"
  cordova-plugin-device 2.0.2 "Device"
  cordova-plugin-dialogs 1.3.4 "Notification"
  cordova-plugin-file 6.0.1 "File"
  cordova-plugin-globalization 1.11.0 "Globalization"
  cordova-plugin-google-analytics 1.8.6 "Google Universal Analytics Plugin"
  cordova-plugin-googleplayservices 19.0.3 "Google Play Services for Android"
  cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
  cordova-plugin-splashscreen 5.0.3-dev "Splashscreen"
  cordova-plugin-statusbar 2.4.2 "StatusBar"
  cordova-plugin-whitelist 1.3.3 "Whitelist"
  cordova-plugin-x-socialsharing 5.4.4 "SocialSharing"
  es6-promise-plugin 4.2.2 "Promise"
  </code></pre>
  </blockquote>
  
  <ul>
  <li>I've downloaded and installed the support repository</li>
  </ul>
  
  <p>What in the name of Ada Lovelace am I missing??????</p>
  
  <p>UPDATE EDIT:</p>
  
  <p>I ran ./gradlew :app:dependencies from the /platforms/android directory and got this:</p>
  
  <pre><code>+--- com.google.android.gms:play-services-analytics:11.0.1
  |    +--- com.google.android.gms:play-services-analytics-impl:[11.0.1] -&gt; 11.0.1
  |    |    +--- com.google.android.gms:play-services-base:[11.0.1] -&gt; 11.0.1
  |    |    |    +--- com.google.android.gms:play-services-basement:[11.0.1] -&gt; 11.0.1
  |    |    |    |    \--- com.android.support:support-v4:25.2.0 -&gt; 24.1.1
  |    |    |    |         \--- com.android.support:support-annotations:24.1.1
  |    |    |    \--- com.google.android.gms:play-services-tasks:[11.0.1] -&gt; 11.0.1
  |    |    |         \--- com.google.android.gms:play-services-basement:[11.0.1] -&gt; 11.0.1 (*)
  |    |    \--- com.google.android.gms:play-services-basement:[11.0.1] -&gt; 11.0.1 (*)
  |    +--- com.google.android.gms:play-services-base:[11.0.1] -&gt; 11.0.1 (*)
  |    +--- com.google.android.gms:play-services-basement:[11.0.1] -&gt; 11.0.1 (*)
  |    \--- com.google.android.gms:play-services-tagmanager-v4-impl:[11.0.1] -&gt; 11.0.1
  |         +--- com.google.android.gms:play-services-analytics-impl:[11.0.1] -&gt; 11.0.1 (*)
  |         +--- com.google.android.gms:play-services-base:[11.0.1] -&gt; 11.0.1 (*)
  |         \--- com.google.android.gms:play-services-basement:[11.0.1] -&gt; 11.0.1 (*)
  +--- com.android.support:support-v4:24.1.1+ -&gt; 24.1.1 (*)
  \--- project :CordovaLib
  </code></pre>
  
  <p>The only library in my /platforms/android/app/libs directory is:
  google-play-services.jar</p>