title: How to import a class from another module in Android Studio 2.0 beta 5?
body: <p>I am trying to import a class from another module which is a library(A). There is another module which is android app(B). So I am trying to import A into B</p>
  
  <p><strong>settings.gradle</strong> :</p>
  
  <pre><code>include ':A', ':B'
  </code></pre>
  
  <p><strong>B build.gradle</strong>   :</p>
  
  <pre><code>  dependencies {
      compile project(':A')   
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:23.1.1'
  
  }
  </code></pre>
  
  <p>When I try to do a gradle sync, it gave me the following error:</p>
  
  <blockquote>
    <p>Error:Conflict with dependency 'org.hamcrest:hamcrest-core'. Resolved
    versions for app (1.1) and test app (1.3) differ. See
    <a href="http://g.co/androidstudio/app-test-app-conflict" rel="nofollow">http://g.co/androidstudio/app-test-app-conflict</a> for details.</p>
    
    <p>Error:Conflict with dependency 'junit:junit'. Resolved versions for
    app (4.8.2) and test app (4.12) differ. See
    <a href="http://g.co/androidstudio/app-test-app-conflict" rel="nofollow">http://g.co/androidstudio/app-test-app-conflict</a> for details.</p>
  </blockquote>
  
  <p>If I remove the line:</p>
  
  <pre><code>    compile project(':A')   
  </code></pre>
  
  <p>the gradle syncs without any error, but I cannot import the A into B.</p>
  
  <p>Can someone suggest me why it is causing the error ?</p>