Gradle cannot resolve dependencies classpath from jcenter() in Android studio
<p>I`m using android studio 1.5.1 on ubuntu.
I want to add <em>google analytic</em> to my android app.So I followed <a href="https://developers.google.com/analytics/devguides/collection/android/v4/#set-up-your-project" rel="nofollow">google analytic document</a> but when I change mavenCentral() to jcenter() , Android studio cannot resolve this classpath:</p>

<pre><code>dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0-beta6'
        classpath 'com.google.gms:google-services:2.0.0-alpha6'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
</code></pre>

<p>When I press "sync project with Gradle files`Button" , Android studio take about 15 minutes and finally says :</p>

<blockquote>
  <p>Error:Connection timed out. If you are behind an HTTP proxy, please
  configure the proxy settings either in IDE or Gradle.</p>
</blockquote>

<p>However I used and did not used proxy , And result was same.</p>

<ol>
<li>Why I cannot connect to jcenter() but I can connect to mavenCentral()?</li>
<li>How can I sync gradle with my project to implement Google Analytic ?</li>
</ol>

<p>Thanks.</p>

<pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0-beta6'
        classpath 'com.google.gms:google-services:2.0.0-alpha6'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        jcenter()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}
</code></pre>

<p>=============================</p>

<pre><code>compile 'com.google.android.gms:play-services:8.4.0'
</code></pre>