title: Android - Multiple dex files defined when importing a jar file
body: <p>I am trying to import caldav4j library (caldav4j-0.7.jar) into my android studio project. I have the following two lines in my build.gradle file.</p>
  
  <pre><code>compile 'org.mnode.ical4j:ical4j:1.0.6'
  compile files('libs/caldav4j-0.7.jar')
  </code></pre>
  
  <p>I am seeing <strong>multiple dex files defined error</strong> due to ical4j library because caldav4j-0.7.jar also has ical4j library defined as a maven dependency. </p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;net.fortuna.ical4j&lt;/groupId&gt;
    &lt;artifactId&gt;ical4j&lt;/artifactId&gt;
    &lt;!--version&gt;1.0-rc1-SNAPSHOT&lt;/version--&gt;&lt;!-- patched on localhost--&gt;
    &lt;version&gt;1.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>If I try to not to import ical4j separately by removing the first line, </p>
  
  <pre><code>compile 'org.mnode.ical4j:ical4j:1.0.6'
  </code></pre>
  
  <p>then I don't have access to ical4j package at all.. What I want to achieve is being able to import any classes from ical4j package. Is it normal for a maven project to not expose its dependencies' packages? Then how am I supposed to use <strong>ical4j</strong> inside my project? All import statements for ical4j library fails if I remove that line from build.gradle.</p>
  
  <pre><code>import net.fortuna.ical4j.model.Component;
  import net.fortuna.ical4j.model.ComponentList;
  import net.fortuna.ical4j.model.component.VEvent;
  </code></pre>
  
  <p><strong>In short:</strong></p>
  
  <p>I want to import <strong>ical4j</strong> library but,</p>
  
  <ol>
  <li><p>It gives me <strong>multiple dex files defined error</strong> if I separately add a line to build.gradle because of the conflicts with the internal dependency defined in caldav4j.jar.</p></li>
  <li><p>If I remove that line, I don't have access to ical4j library at all because caldav4j.jar does not expose its dependencies..</p></li>
  </ol>
  
  <p>Thanks for your help in advance :)</p>