title: Could not resolve junit:junit:4.12
body: <p>I am using Android studio 2.2 and I am trying to compile the sample android application given in the get started section of developer.android.com. When I build the application I get the following error.</p>
  
  <blockquote>
    <p>Could not resolve junit:junit:4.12.
    Could not get resource '<a href="https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom" rel="nofollow noreferrer">https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom</a>'.
    Could not GET '<a href="https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom" rel="nofollow noreferrer">https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom</a>'.
    Connect to jcenter.bintray.com:443 [jcenter.bintray.com/75.126.118.188] failed: Connection timed out: connect</p>
  </blockquote>
  
  <p>I have gone through a number of threads in stackoverflow.com related to this error. I did the following as suggested in these threads, but my problem is not resolved.</p>
  
  <h2>Step 1</h2>
  
  <p>Updated buildgrid{} section of build.gradle (application) with this:</p>
  
  <pre><code>repositories {
          maven { url 'http://repo1.maven.org/maven2' }
      }
  </code></pre>
  
  <h2>Step 2</h2>
  
  <p>Updated android{} section of build.gradle (module) with this:</p>
  
  <pre><code> repositories {
          maven { url 'http://repo1.maven.org/maven2' }
      }
  </code></pre>
  
  <p>I have also configured manual proxy with a proper proxy server IP and I could also test the connection successuflly to URL <a href="https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom" rel="nofollow noreferrer">https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom</a>. I have also pasted this URL in a web browser, which downloads the junit-4.12.pom successfully. What I am not able to understand is, when connection to the above URL is successful, why the build fails?</p>