简体   繁体   English

无法解析 com.google.gms:google-services:3.0.0

[英]Could not resolve com.google.gms:google-services:3.0.0

I read many posts on this topic, but no one helped me.我阅读了很多关于这个主题的帖子,但没有人帮助我。 I'm using Android Studio and following this guide我正在使用 Android Studio 并遵循本指南

This is the project gradle:这是项目gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:3.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

this is the app gradle:这是应用程序gradle:

apply plugin: 'com.android.application'

    android {
        compileSdkVersion 25
        buildToolsVersion "25.0.1"
        defaultConfig {
            applicationId "com.xyv.appname"
            minSdkVersion 15
            targetSdkVersion 25
            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'])
        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
        compile 'com.android.support:appcompat-v7:25.0.1'
        compile 'com.android.support:design:25.0.1'
        testCompile 'junit:junit:4.12'
        compile 'com.google.firebase:firebase-core:10.0.1'        
    }
    apply plugin: 'com.google.gms.google-services'

Here you can see where I added google-services.json inside my app:在这里您可以看到我在应用程序中添加 google-services.json 的位置:

在此处输入图片说明

These are my SDK tools:这些是我的 SDK 工具:

在此处输入图片说明

Does anybody understand what's my error?有人明白我的错误是什么吗?

Thank you in advance先感谢您

You may need to add您可能需要添加

compile 'com.google.android.gms:play-services:9.6.1'

in your app build.gradle also.在您的应用程序 build.gradle 中。 ref: Upgrade to Google Play Services:9.0.0 Error Failed to resolve: com.google.android.gms:play-services-measurement:9.0.0参考: 升级到 Google Play 服务:9.0.0 错误无法解决:com.google.android.gms:play-services-measurement:9.0.0

If you recently bumped the version to 3.0.0 you should doublecheck that you have installed the correct version on your machine in the Android SDK manager.如果您最近将版本提高到 3.0.0,您应该在 Android SDK 管理器中仔细检查您的机器上是否安装了正确的版本。

Open the stand alone SDK Manager, in the Extras section the you will find "Google Play Services" update it .打开独立的 SDK Manager,在 Extras 部分你会发现“Google Play Services”更新它。

在此处输入图片说明

我通过将 android studio 更新到 2.3 beta 2 解决了我的问题我只是更新了一个 android studio,一切都在破坏

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 添加类路径'com.google.gms:google-services:1.5.0-beta2'后,Androidstudio无法解析依赖关系 - Androidstudio can not resolve dependencies after adding classpath 'com.google.gms:google-services:1.5.0-beta2' 错误:找不到com.google.gms:google-services:1.0。在android studio中的build.gradle中添加google服务插件时 - Error: Could not find com.google.gms:google-services:1.0. when adding google service plugin in build.gradle in android studio 更新为实现“ com.google.android.gms:play-services-ads:15.0.2”和类路径“ com.google.gms:google-services:3.3.0”后,出现Gradle错误 - Gradle error after updating to implementation 'com.google.android.gms:play-services-ads:15.0.2' and classpath 'com.google.gms:google-services:3.3.0' Google服务应用插件错误,无法解决com.google.android.gms.11.0.4,错误:(45,0) - Google-services apply plugin error, failed to resolve com.google.android.gms.11.0.4 and Error:(45,0) 错误:gradle和gms Google服务 - Error: gradle and gms google-services 无法解析 com.google.android.gms:play-services-ads:19.1.0 - Could not resolve com.google.android.gms:play-services-ads:19.1.0 无法解析 com.google.android.gms:play-services-location:16.+ - Could not resolve com.google.android.gms:play-services-location:16.+ 找不到插件:“com.google.gms.google-services” - Could not found plugin: 'com.google.gms.google-services' 无法解析配置':app:_debugApkCopy'的所有依赖项。 找不到com.google.android.gms:play-services-appindexing:10.0.1 - Could not resolve all dependencies for configuration ':app:_debugApkCopy'. Could not find com.google.android.gms:play-services-appindexing:10.0.1 无法解决:com.google.android.gms:play-services-gcm:7.5。+ - Failed to resolve: com.google.android.gms:play-services-gcm:7.5.+
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM