Android 缺少文件google-services.json,但需要哪些服务?

Android 缺少文件google-services.json,但需要哪些服务?,android,gradle,firebase,google-play-services,Android,Gradle,Firebase,Google Play Services,我在使用几天前推出的Firebase新功能时遇到了一些问题。我的应用程序以前使用过Firebase,但现在我想添加存储功能。因此,我将依赖项添加到我的gradle文件中: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.firebase:firebase-client-android:2.5.2+' compile 'com.firebase:geofire:1.1.0+' testCom

我在使用几天前推出的Firebase新功能时遇到了一些问题。我的应用程序以前使用过Firebase,但现在我想添加存储功能。因此,我将依赖项添加到我的gradle文件中:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.firebase:firebase-client-android:2.5.2+'
compile 'com.firebase:geofire:1.1.0+'
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
compile 'com.google.firebase:firebase-storage:9.0.0' }
我在下面补充说:

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

因为我以前没有使用过谷歌服务的插件,所以我丢失了谷歌服务.json文件。正如这里提到的,我应该通过指定应用程序使用的服务从谷歌获得这个文件。但是,我只使用Places API,而我只能在此处指定“登录”、“云消息”、“分析”、“应用邀请”和“广告群”:

如果您在登录后转到此链接,您将看到一个按钮,上面写着“将Firebase添加到您的Android应用程序”。点击它,弹出窗口就会出现。在第2步中,它将为您提供一个google-servies.json文件的下载链接。按照步骤进行操作,您就完成了。

mikewee的回答对我不起作用,因为我已经完成了迁移到firebase的过程


相反,此处的说明将为您提供一个google services.json

下载Android应用程序的google service.json

  • 登录到Firebase并打开您的项目
  • 单击并选择“项目设置”
  • 在您的应用程序卡中,从列表中选择需要配置文件的应用程序的程序包名称
  • 单击谷歌服务.json

然后将google services.json文件粘贴到项目的应用程序文件夹中

mikwee绝对正确。另一个医生的观点也很好!Firebase版本是,但我们将更新您找到的版本,以链接到Firebase版本,供使用Firebase服务的用户使用。您还需要在项目级别添加google服务。如果第2步的下载不包含“api\u密钥/当前\u密钥”,您需要单击“管理”从概述中的应用程序卡重新下载文件。