【问题标题】:Error: File google-services.json is missing. The Google Services Plugin cannot function without it.错误:文件 google-services.json 丢失。没有它,Google 服务插件将无法运行。
【发布时间】:2016-06-17 08:00:32
【问题描述】:
我已经在我的应用程序中包含了 google-services.json 文件,但它仍然给我错误。
错误:任务 ':app:processDebugGoogleServices' 执行失败。
文件 google-services.json 丢失。没有它,Google 服务插件将无法运行。
搜索位置:
C:\Users\vikas\AndroidStudioProjects\FireBaseFunctionality\app\src\debug\google-services.json
C:\Users\vikas\AndroidStudioProjects\FireBaseFunctionality\app\google-services.json
【问题讨论】:
标签:
android
json
firebase
【解决方案2】:
进入SDK管理器--> SDK工具---->安装播放服务和USB工具和存储库
我用上述方法解决了同样的问题
或者你可以更改谷歌服务的名称
google-services.json 而不是
google-services(任意数量).json
【解决方案3】:
只需在 build.gradle 中更改这一行
compile fileTree (dir: 'libs', include: ['* .jar'])
到
implementation fileTree(dir: 'libs', include: ['*.jar'])
【解决方案4】:
转到用于构建应用程序的 Flutter sdk 文件夹。删除文件夹 .pub-cache 中的所有内容
现在 pub-get 并运行。
【解决方案5】:
有时我们会复制下载的文件并放在 app 目录中。但它改变了名称。例如 googleservices(1).json 而不是 googleservices.json。所以请确保文件名正确。
【解决方案6】:
对我有用的是:
然后按照https://console.firebase.google.com的步骤在android studio中做:
项目级 build.gradle (/build.gradle):
buildscript {
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
}
dependencies {
...
// Add this line
classpath 'com.google.gms:google-services:4.3.8'
}
}
allprojects {
...
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
...
}
}
应用级 build.gradle (//build.gradle):
apply plugin: 'com.android.application'
// Add this line
apply plugin: 'com.google.gms.google-services'
dependencies {
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:28.3.0')
// Add the dependency for the Firebase SDK for Google Analytics
// When using the BoM, don't specify versions in Firebase dependencies
implementation 'com.google.firebase:firebase-analytics'
// Add the dependencies for any other desired Firebase products
// https://firebase.google.com/docs/android/setup#available-libraries
}
最后,在 IDE 中显示的栏中按“立即同步”:
【解决方案7】:
将您的 googleservices(number).json 更改为 googleservices.json 没有对我有用的数字我刚遇到同样的问题。