Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/214.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Gradle错误:同步应用程序时出现Google服务错误_Android_Gradle_Google Api - Fatal编程技术网

Android Gradle错误:同步应用程序时出现Google服务错误

Android Gradle错误:同步应用程序时出现Google服务错误,android,gradle,google-api,Android,Gradle,Google Api,我面临着谷歌服务的问题。我想将登录API添加到我的应用程序中,但由于以下错误,我无法同步该应用程序: Error:Could not find com.google.gms:google-services:3.0.0. Searched in the following locations: file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-service

我面临着谷歌服务的问题。我想将登录API添加到我的应用程序中,但由于以下错误,我无法同步该应用程序:

    Error:Could not find com.google.gms:google-services:3.0.0.
Searched in the following locations:
    file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/3.0.0/google-services-3.0.0.pom
    file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/3.0.0/google-services-3.0.0.jar
    https://maven.fabric.io/public/com/google/gms/google-services/3.0.0/google-services-3.0.0.pom
    https://maven.fabric.io/public/com/google/gms/google-services/3.0.0/google-services-3.0.0.jar
Required by:
    DelSnapUser-Dometics:app:unspecified
这是我的格拉德尔:

  buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public'}
    jcenter()
    mavenCentral()
}


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.example.delsnap_user_domestic.delsnapuser_dometics"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.+'
    compile 'com.android.support:design:23.+'
}
请帮我解决。。。感谢并感谢:)

改变

  buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

buildscript{
存储库{

jcenter()//我认为您在问这个问题。换句话说,我认为您不需要在问题的第二个
存储库
块中使用
maven{url
  buildscript {
    repositories {
        jcenter() // <-- Added
        maven { url 'https://maven.fabric.io/public' }
    }