错误:找不到 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

查看:31
本文介绍了错误:找不到 com.google.gms:google-services:1.0.在android studio的build.gradle中添加google服务插件时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照 教程.

根据教程,我应该通过添加classpath 'com.google.gms:google-services:1.0' 对我 android 项目中顶级 build.gradle 的依赖.

According to the tutorial, I should add the Google Service plugin by adding classpath 'com.google.gms:google-services:1.0' dependency to top-level build.gradle in my android project.

但是,当我将 gradle 与更改同步时,我看到如下错误:

However, when I sync the gradle with the changes, I see the error as follows:

错误:找不到 com.google.gms:google-services:1.0.

Error:Could not find com.google.gms:google-services:1.0.

在以下位置搜索:文件:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/1.0/google-services-1.0.pom文件:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/1.0/google-services-1.0.jarhttps://jcenter.bintray.com/com/google/gms/google-services/1.0/google-services-1.0.pomhttps://jcenter.bintray.com/com/google/gms/google-services/1.0/google-services-1.0.jar

Searched in the following locations: file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/1.0/google-services-1.0.pom file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/1.0/google-services-1.0.jar https://jcenter.bintray.com/com/google/gms/google-services/1.0/google-services-1.0.pom https://jcenter.bintray.com/com/google/gms/google-services/1.0/google-services-1.0.jar

在我的build.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:1.2.3'
        classpath 'com.google.gms:google-services:1.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

android studio 似乎无法从存储库中找到 google-services 插件.

It seems that the android studio is not able to find google-services plugin from repositories.

有人遇到同样的问题吗?或者,我错过了什么?

Does anybody have the same issue? Or, am I missing something?

推荐答案

我今天遇到了同样的问题.在示例中,他们改用这一行:<代码>类路径 'com.google.gms:google-services:1.3.0-beta1'这有效.

I ran into the same issue today. In the samples they use this line instead: classpath 'com.google.gms:google-services:1.3.0-beta1' This works.

这篇关于错误:找不到 com.google.gms:google-services:1.0.在android studio的build.gradle中添加google服务插件时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆