我在ubuntu上使用android studio 1.5.1。 我想谷歌分析添加到我的Android app.So我跟着google analytic document,但是当我改变mavenCentral()来jcenter(),机器人工作室无法解决此类路径:当我按下“同步工程在Android Studio中,Gradle无法解析来自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
}
与摇篮files`Button”,Android的工作室大约需要15分钟,最后说:
Error:Connection timed out. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.
不过我用的,并没有使用代理,而结果是一样的。
- 为什么我不能连接到jcenter(),但我可以连接到mavenCentral()?
- 如何将Gradle与我的项目同步以实施Google Analytic?
谢谢。
// 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'
为什么要在您的buildscript类路径中添加com.google.gms:google-services:2.0.0-alpha6'?这似乎不是设置说明的一部分。 –