title: How to remedy error caused by guava: Program type already present: com.google.common.util.concurrent.internal.InternalFutures
body: <p>An AAR library already uses com.google.guava.</p>
  
  <p>If an app includes the following in its build.gradle:</p>
  
  <pre><code>api 'com.google.guava:guava:27.0-android'
  </code></pre>
  
  <p>Building the app generates the following error:</p>
  
  <pre><code>Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
  &gt; com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: ...
    Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
    Program type already present: com.google.common.util.concurrent.internal.InternalFutures
  </code></pre>
  
  <p>If I do not include "api 'com.google.guava:guava:27.0-android'", the app can be built, but it has runtime error of java.lang.NoClassDefFoundError when it reaches the point of using the Guava method: Iterables.find</p>