title: How to use Apache Tika on Android
body: <p>I'm trying to use Apache tika to parse some documents but it giving me so many errors and warnings.</p>
  
  <p><strong>build.gradle</strong></p>
  
  <pre><code>dependencies {
      ...
      compile ('org.apache.tika:tika-parsers:1.14'){
          exclude group: 'org.json', module: 'json'
          exclude group: 'commons-logging', module: 'commons-logging'
          exclude group: 'org.apache.httpcomponents', module: 'httpclient'}
  ...
  }
  </code></pre>
  
  <p>To make this question easier to read, I'll not paste the warnings here (they are 600+) and I will ignore them but the errors are these:</p>
  
  <pre><code>Error:Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/apache/xmlbeans/xml/stream/Location;
  Error:Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/apache/xmlbeans/xml/stream/ReferenceResolver;
  Error:Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/apache/xmlbeans/xml/stream/XMLEvent;
  Error:Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/apache/xmlbeans/xml/stream/XMLInputStream;
  Error:Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/apache/xmlbeans/xml/stream/XMLName;
  Error:Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/apache/xmlbeans/xml/stream/XMLStreamException;
  Error:Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/apache/xmlbeans/xml/stream/utils/NestedThrowable;
  Error:Uncaught translation error: java.lang.IllegalArgumentException: already added: Lorg/apache/xmlbeans/xml/stream/utils/NestedThrowable$Util;
  Error:8 errors; aborting
  Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
  &gt; com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process
  Information:BUILD FAILED
  </code></pre>
  
  <p>Please do you have a solution to this. Or better still, do you know a better library that I can use to extract the metadata of documents?</p>