2016-07-16 113 views
0

我想添加classpath'com.google.gms:google-services:1.5.0-beta2'在根級build.gradle文件但添加classpath後,它不斷顯示我解決類路徑和它給我的錯誤添加classpath'com.google.gms:google-services:1.5.0-beta2'後,Androidstudio無法解析依賴項'

錯誤:連接超時:連接。如果您位於HTTP代理後面,請在IDE或Gradle中配置代理設置。

我的應用程序級的build.gradle是

apply plugin: 'com.android.application' 


android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.3" 
    defaultConfig { 
     applicationId "com.gmail.com.signingmail" 
     minSdkVersion 15 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha2' 
    testCompile 'junit:junit:4.12' 
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' 
    androidTestCompile 'com.android.support.test:runner:0.5' 
    androidTestCompile 'com.android.support:support-annotations:23.4.0' 
    compile 'com.google.android.gms:play-services:8.3.0' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
} 
apply plugin: 'com.google.gms.google-services' 

我的根級的build.gradle是。

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.2.0-alpha5' 
     classpath 'com.google.gms:google-services:1.5.0-beta2' 

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

試試這個類路徑「com.google.gms:谷歌服務:3.0.0」 和應用gradle這個文件的此行結束:應用插件:「com.google.gms.google服務」 –

+0

你使用舊版Google Play服務。 9.2是最新的我猜.https://developers.google.com/android/guides/setup和插件https://developers.google.com/android/guides/google-services-plugin。更新你從android sdk manager支持respository並更新google play服務。使用最新的庫 – Raghunandan

+0

是@Raghunandan 9.2.0是最新的。 –

回答

0

好的,我解決了這個問題,這是因爲我的防病毒軟件誰阻止連接android-studio。我只是關閉防病毒,現在它的工作。

相關問題