title: Android Gradle build fails: Could not find com.google.android:support-v4:r18
body: <p><strong>EDIT:</strong></p>
  
  <blockquote>
    <p><strong>This issue seemed to disappear by its own somehow, possibly due to the new Gradle build system becoming more mature.</strong></p>
  </blockquote>
  
  <p>I have two separate Android projects:</p>
  
  <p>The 1st project is an Android Library using <em>'android-library'</em> plugin for Gradle, which depends on the <strong>support-library-v4:r18</strong>. Snippet from <em>dependencies</em> in <em>build.gradle</em>:</p>
  
  <pre><code>compile 'com.android.support:support-v4:18.0.0'
  </code></pre>
  
  <p>The support library is fetched from <em>Android Support Repository</em> installed via <em>Android SDK Manager</em> as explained <a href="https://stackoverflow.com/questions/16740139/gradle-and-android-support-library">here</a>. This project is then built and published to maven local repository by running: <code>gradle uploadArchives</code></p>
  
  <p>I verified and indeed the library <strong>.aar</strong> is then available under the local maven repository.</p>
  
  <p>The 2nd project is an Android app using <em>'android'</em> plugin for Gradle, which references the <strong>maven dependency</strong> of the library produced by the first project. Here is a snippet from <em>build.gradle</em>:</p>
  
  <pre><code>repositories {
      mavenLocal()
      mavenCentral()
  }
  dependencies {
      compile 'com.android.support:support-v4:18.0.0'
      compile 'com.example:cool-lib:1.0.0-SNAPSHOT'
  }
  </code></pre>
  
  <blockquote>
    <p><strong>NOTE: The two projects are completely separated from another. Meaning that,
    they are NOT subprojects of the same root project.</strong></p>
  </blockquote>
  
  <p>When I try to build the 2nd project by running: <code>gradle assemble</code></p>
  
  <p>I get the following error:</p>
  
  <pre><code>Could not find com.google.android:support-v4:r18.
  Required by:
      com.example:app-project:unspecified &gt; com.example:cool-lib:1.0.0-SNAPSHOT
  </code></pre>
  
  <p>I checked the <strong>.pom</strong> file of <em>cool-lib</em>, under my local maven repo folder and I saw that it has the following dependency:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;com.android.support&lt;/groupId&gt;
    &lt;artifactId&gt;support-v4&lt;/artifactId&gt;
    &lt;version&gt;18.0.0&lt;/version&gt;
    &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>For some reason, Gradle is trying to get the <em>support library-v4 <strong>r18</em></strong> for the <em>lib-project</em> from maven central repository instead of getting it from <em>Android Support Repository</em>. It fails since the latest version in Maven Central of the <em>support-library-v4</em> is <strong>r7</strong>.</p>
  
  <p>Is there a way to force Gradle to strictly fetch the <em>support-library-v4 <strong>r18</em></strong> from <em>Android Support Repository</em> also for external Android libraries which are referenced from Maven Central?</p>