I`m using android studio 1.5.1 on ubuntu. I want to add google analytic to my android app.So I followed google analytic document but when I change mavenCentral() to jcenter() , Android studio cannot resolve this classpath:
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
}
When I press "sync project with Gradle files`Button" , Android studio take about 15 minutes and finally says :
Error:Connection timed out. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.
However I used and did not used proxy , And result was same.
- Why I cannot connect to jcenter() but I can connect to mavenCentral()?
- How can I sync gradle with my project to implement Google Analytic ?
Thanks.
// 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
}
=============================
compile 'com.google.android.gms:play-services:8.4.0'