我在使用几天前推出的新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' }
Run Code Online (Sandbox Code Playgroud)
下面我补充说:
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
由于我以前没有使用谷歌服务的插件,我错过了google-servies.json文件.正如此处所述https://developers.google.com/android/guides/google-services-plugin#troubleshooting我应该通过指定应用使用的服务从谷歌获取此文件.不过,我只使用Places API,而我只能指定"登录","云通讯","分析","应用程式邀请"和"广告暴民"在这里:https://developers.google.com/移动/加