2016-03-28 18 views
0

私はアンドロイドスタジオ1.5.1をubuntuで使用しています。 は私がgoogle analytic documentを追った私のアンドロイドapp.SoにGoogleの分析を追加したいが、私はmavenCentralを変更した場合()、Androidのスタジオは、このクラスパス解決することはできません)(jcenterする:私は「同期プロジェクトを押すとAndroidスタジオの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 
    } 

をGradleの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.

しかし、私は使用してプロキシを使用していなかった、そして、結果は同じでした。

  1. なぜ私はj​​center()に接続できませんが、mavenCentral()に接続できますか?
  2. Googleアナリティクスを実装するためにgradleを自分のプロジェクトと同期させるにはどうすればよいですか?

ありがとうございます。

// 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' 
+0

なぜあなたのbuildscriptクラスパスに 'com.google.gms:google-services:2.0.0-alpha6'を追加していますか?セットアップ手順の一部ではないようです。 –

答えて

0

一部のサイトにアクセスしたり、それらのサイトからダウンロードしたりできます。

あなたのオフィスで働いている場合は、プロキシサーバーがある可能性があります。 Gradle依存関係のダウンロードを制限しています。

A proxy or proxy server is basically another computer which serves as a hub through which internet requests are processed. By connecting through one of these servers, your computer sends your requests to the proxy server which then processes your request and returns what you were wanting.

0

このも まずあなたのインターネットのプロキシ設定をチェックしてみは、プロキシのホストとポートがないなどのプロキシ設定をコピーします。そしてプロジェクトにあなたの「gradle.properties」ファイルに移動し、一般的に、この

よう
systemProp.http.proxyHost="copied proxy host" 
systemProp.http.proxyPort="copied proxy port" 

systemProp.https.proxyHost="copied proxy host" 
systemProp.https.proxyPort="copied proxy port" 

を貼り付ける人は、httpため、システムの小道具を貼り付けるが、その両方を貼り付けてくださいhttpsのために忘れています。

関連する問題