Google 服务 3.0.0 缺少 api_key/current 密钥
- 作者: 小鹿姐_
- 来源: 51数据库
- 2022-11-02
问题描述
由于我使用最新版本的谷歌服务和库(9.0.0)升级了项目,我遇到了这个奇怪的问题:
Since I upgraded the project with the latest version of google services and libraries (9.0.0), I have this strange issue :
等级控制台:
:app:processDebugGoogleServices Parsing json file: /Users/cyrilmorales/Documents/Projects/mobilemeans-punainenristi/app/google-services.json :app:processDebugGoogleServices FAILED Error:Execution failed for task ':app:processDebugGoogleServices'. > Missing api_key/current_key object Information:BUILD FAILED
build.gradle(根):
build.gradle (root) :
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0-alpha1'
classpath 'com.google.gms:google-services:3.0.0'
}
build.gradle(应用程序):
build.gradle (app) :
dependencies {
....
compile 'com.google.android.gms:play-services-analytics:9.0.0'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'com.google.android.gms:play-services-maps:9.0.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
...
}
apply plugin: 'com.google.gms.google-services'
但是,它可以很好地与 8.4.0 和 google-services 2.1.0 中的播放服务库配合使用
However, it works well with the play service libraries in 8.4.0 and google-services 2.1.0
你知道解决办法吗?
推荐答案
从 https://developers.google.com/cloud-messaging/android/client#get-config
新的配置文件 "api_key": [ { "current_key": XXX } ] 在客户端部分
Newly config file with "api_key": [ { "current_key": XXX } ] in client section
更新:或在开发者控制台中手动启用服务并生成密钥.
Update: or manually enabled service in developer console and generate key.
推荐阅读
热点文章
检查拆分键盘
0
带有“上一个"的工具栏和“下一个"用于键盘输入AccessoryView
0
Activity 启动时显示软键盘
0
UIWebView 键盘 - 摆脱“上一个/下一个/完成"酒吧
0
在 iOS7 中边缘滑动时,使键盘与 UIView 同步动画
0
我的 iOS 应用程序中的键盘在 iPhone 6 上太高了.如何在 XCode 中调整键盘的分辨率?
0
android:inputType="textEmailAddress";- '@' 键和 '.com' 键?
0
禁用 iPhone 中键盘的方向
0
Android 2.3 模拟器上的印地语键盘问题
0
keyDown 没有被调用
0
