简体   繁体   English

错误:文件 google-services.json 丢失。 (因为 com.google.gms:google-services 从 4.2.0 更新到 4.3.0)

[英]ERROR: File google-services.json is missing. (Since com.google.gms:google-services updated from 4.2.0 to 4.3.0)

Since I updated com.google.gms:google-services from version 4.2.0 to 4.3.0 in my top level build.gradle, I cannot compile my project any more because I have the error :由于我在顶级 build.gradle 中将com.google.gms:google-services从版本 4.2.0 更新为 4.3.0,因此我无法再编译我的项目,因为出现错误:

"File google-services.json is missing" “文件 google-services.json 丢失”

My google-services.json are in :我的google-services.json位于:

  • /My/personnal/project/app/src/ProductFlavors/BuildTypes

(for example) (例如)

  • /My/personnal/project/app/src/AT/debug

  • /My/personnal/project/app/src/DE/debug

  • /My/personnal/project/app/src/AT/release (...)

When my version is 4.2.0, I have no issue but in 4.3.0 I have the error and the Searched Location is: /My/personnal/project/app/google-services.json当我的版本为 4.2.0 时,我没有问题,但在 4.3.0 中出现错误,搜索位置为:/My/personnal/project/app/google-services.json

not working不工作

dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath 'com.google.gms:google-services:4.3.0'
    }

working在职的

dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath 'com.google.gms:google-services:4.2.0'
    }

EDIT 1编辑 1

Looks like it has been resolved with version 4.3.1貌似4.3.1版本已经解决了

EDIT 2编辑 2

Looks like issue is back on version 4.3.2 :(看起来问题又回到了 4.3.2 版:(

EDIT 3编辑 3

Issue still there with 4.3.3 :(问题仍然存在 4.3.3 :(

There is already an open issue on github based on this基于此,github上已经有一个未解决的问题

https://github.com/google/play-services-plugins/issues/91 https://github.com/google/play-services-plugins/issues/91

The problem is google-services plugin ignores the build variant if it starts with a capital letter.问题是 google-services 插件会忽略以大写字母开头的构建变体。

If you refactor the build variant names to camelCase, then it seems to detect the google-services.json file.如果您将构建变体名称重构为驼峰命名法,那么它似乎会检测到 google-services.json 文件。

Since I updated com.google.gms:google-services from version 4.2.0 to 4.3.0 in my top level build.gradle, I cannot compile my project any more because I have the error :自从我在顶级build.gradle中将com.google.gms:google-services从4.2.0版本更新为4.3.0以来,由于存在以下错误,我无法再编译项目:

"File google-services.json is missing" “缺少文件google-services.json”

My google-services.json are in :我的google-services.json位于:

  • /My/personnal/project/app/src/ProductFlavors/BuildTypes

(for example) (例如)

  • /My/personnal/project/app/src/AT/debug

  • /My/personnal/project/app/src/DE/debug

  • /My/personnal/project/app/src/AT/release (...)

When my version is 4.2.0, I have no issue but in 4.3.0 I have the error and the Searched Location is: /My/personnal/project/app/google-services.json当我的版本是4.2.0时,我没有问题,但是在4.3.0中,我出现了错误,并且“搜索位置”是:/My/personnal/project/app/google-services.json

not working不工作

dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath 'com.google.gms:google-services:4.3.0'
    }

working在职的

dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath 'com.google.gms:google-services:4.2.0'
    }

EDIT 1编辑1

Looks like it has been resolved with version 4.3.1看起来它已在4.3.1版中解决

EDIT 2编辑2

Looks like issue is back on version 4.3.2 :(看起来问题又回到了版本4.3.2 :(

EDIT 3编辑3

Issue still there with 4.3.3 :(问题仍然存在4.3.3 :(

将此行添加到应用程序 build.gradle 文件的底部,而不是顶部。

apply plugin: 'com.google.gms.google-services'

You need to get the configuration file from the developer's site and paste it in the app level directory of your project.您需要从开发者站点获取配置文件并将其粘贴到您项目的应用程序级目录中。 Generate file here developers.在这里开发人员生成文件。 google.com/mobile/add google.com/mobile/add

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

相关问题 com.google.gms:google-services:4.3.4 选择了不正确的 google-services.json - Incorrect google-services.json is picked by com.google.gms:google-services:4.3.4 错误:找不到com.google.gms:google-services:4.2.0 - Error: could not find com.google.gms:google-services:4.2.0 应用插件错误:“ com.google.gsm.google-services”还添加了类路径“ com.google.gms:google-services:4.2.0” - Error apply plugin: 'com.google.gsm.google-services' also added classpath 'com.google.gms:google-services:4.2.0' 使用 com.google.gms 时出错:google-services: 4.3.4 - Error using com.google.gms: google-services: 4.3.4 无法更新到com.google.gms:google-services:4.2.0 - Can't update to com.google.gms:google-services:4.2.0 有什么办法可以从顶级项目gradle中删除“ classpath'com.google.gms:google-services:4.2.0”依赖项 - Is there any way to remove "classpath 'com.google.gms:google-services:4.2.0' dependency from top level project gradle 无法解析 com.google.gms:google-services:4.3.3 - Could not resolve com.google.gms:google-services:4.3.3 找不到com.google.gms:google-services:9.0.0 - Could not find com.google.gms:google-services:9.0.0 找不到 com.google.gms:google-services:4.2.3 - Could not find com.google.gms:google-services:4.2.3 无法解析 com.google.gms:google-services:3.0.0 - Could not resolve com.google.gms:google-services:3.0.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM