title: Android Studio: Gradle sync failed: Project :app declares a dependency
body: <p>I am working in Android Studio 2.3 and I want to make use of a library I found on github (<a href="https://github.com/henrychuangtw/Android-ChatHead" rel="noreferrer">https://github.com/henrychuangtw/Android-ChatHead</a>) and there is no Jar file.
  In settings.gradle I have declared the directory in which the library resides in like this: </p>
  
  <pre><code>include ':app'
  include ':Android-ChatHead'
  
  project(':Android-ChatHead').projectDir=new File('/Users/lorand/AndroidStudioProjects/Doritest/android_chatHeads')
  </code></pre>
  
  <p>And I have also added the library to the build.gradle dependencies:</p>
  
  <pre><code>dependencies {
  
          compile fileTree(dir: 'libs', include: ['*.jar'])
  
          compile project(':Android-ChatHead')
  
          androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
              exclude group: 'com.android.support', module: 'support-annotations'
          })
          compile 'com.android.support:appcompat-v7:25.1.1'
          compile 'com.android.support.constraint:constraint-layout:1.0.2'
          testCompile 'junit:junit:4.12'
      }
  </code></pre>
  
  <p>After this, if I sync, I get this error:</p>
  
  <blockquote>
    <p>Gradle sync failed: Project :app declares a dependency from
    configuration 'compile' to configuration 'default' which is not
    declared in the descriptor for project :Android-ChatHead.             Consult
    IDE log for more details (Help | Show Log)</p>
  </blockquote>
  
  <p>If I add /app to the end of the file path in settings.gradle, I get the following error:</p>
  
  <pre><code>Error:Dependency Doritest:Android-ChatHead:unspecified on project core resolves to an APK archive which is not supported as a compilation dependency. 
  File: /Users/lorand/AndroidStudioProjects/Doritest/android_chatHeads/Android-ChatHead/app/build/outputs/apk/Android-ChatHead-release-unsigned.apk
  </code></pre>
  
  <p>I cannot figure out what I should do.</p>