title: How to use ElasticSearch API in Android
body: <p>Can anyone explain how can I use the ElasticSearch API in Android.
  Does anyone successfully integrated the api in android?</p>
  
  <p>I added following dependencies in Gradle:</p>
  
  <pre><code>compile 'org.elasticsearch.client:transport:5.2.1'
  </code></pre>
  
  <p>Of course I run into issues:</p>
  
  <blockquote>
    <p>Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
    com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
        File1: C:\Users\dude.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpcore-nio\4.4.5\f4be009e7505f6ceddf21e7960c759f413f15056\httpcore-nio-4.4.5.jar
        File2: C:\Users\dude.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpasyncclient\4.1.2\95aa3e6fb520191a0970a73cf09f62948ee614be\httpasyncclient-4.1.2.jar
        File3: C:\Users\dude.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.dataformat\jackson-dataformat-yaml\2.8.6\8bd44d50f9a6cdff9c7578ea39d524eb519e35ab\jackson-dataformat-yaml-2.8.6.jar
        File4: C:\Users\dude.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpcore\4.4.5\e7501a1b34325abb00d17dde96150604a0658b54\httpcore-4.4.5.jar
        File5: C:\Users\dude.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.8.6\2ef7b1cc34de149600f5e75bc2d5bf40de894e60\jackson-core-2.8.6.jar</p>
  </blockquote>
  
  <p>.</p>
  
  <p><strong>UPDATE 1:</strong></p>
  
  <p>Well I have to use the REST API using <a href="https://loopj.com/android-async-http/" rel="noreferrer">Android Asynchronous Http Client</a>, because <a href="https://stackoverflow.com/questions/34031395/errorexecution-failed-for-task-apptransformresourceswithmergejavaresfordebug">adding packagingOptions</a> does <strong>not</strong> solve the issue</p>