文件google-services.json丢失,但有什么服务? [英] File google-services.json is missing, but what services?

查看:1099
本文介绍了文件google-services.json丢失,但有什么服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

$ p code $ dependency {
compile fileTree(dir:'libs',include :['* .jar'])
编译'com.firebase:firebase-client-android:2.5.2+'
编译'com.firebase:geofire:1.1.0+'
testCompile'junit:junit:4.12'
compile'c​​om.android.support:appcompat-v7:23.2.0'
compile'c​​om.android.support:design:23.2.0'
编译'com.google.android.gms:play-services-location:9.0.0'
编译'com.google.firebase:firebase-storage:9.0.0'}


$ b

下面我加了:

  apply插件:'com.google.gms.google-services'

由于我没有使用插件对于google-services之前,我缺少 google-servies.json 文件。如这里所述 https://developers.google.com/android/guides/ google-services-plugin#疑难解答我应该通过指定应用程序使用的服务从谷歌获得这个文件。不过,我只能使用Places API,而我只能在这里指定登录,云消息传递,分析,应用邀请和广告手机: https://developers.google.com/mobile/add

解决方案

如果您转到此链接 https://console.firebase .google.com / project / yourprojectname / overview 时,您将看到一个按钮向您的Android应用程序添加Firebase。点击它,弹出窗口会显示出来。在第2步,它会给你一个google-servies.json文件的下载链接。按照步骤,你就完成了。


I'm facing issues when using one of the new Firebase features which came out a few days ago. My application has used Firebase before, but now I want to add the storage feature. Therefore I added the dependency to my gradle file:

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' }

Below I added:

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

As I haven't used the plugin for google-services before, I am missing the google-servies.json file. As noted here https://developers.google.com/android/guides/google-services-plugin#troubleshooting I am supposed to get this file from google by specifying the services the app uses. However, I only use the Places API, while I can only specify "Sign-In", "Cloud Messaging", "Analytics", "App Invites" and "Ad Mob" here: https://developers.google.com/mobile/add

解决方案

if you go to this link "https://console.firebase.google.com/project/yourprojectname/overview" when already logged in, you will see a button saying "Add Firebase to your Android app". Click on it and a popup will show up. On step 2 it will give you a download link for the google-servies.json file. Follow the steps and you're done.

这篇关于文件google-services.json丢失,但有什么服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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