Google服务3.0.0版缺少api_key /当前键 [英] Missing api_key/current key with Google Services 3.0.0

查看:217
本文介绍了Google服务3.0.0版缺少api_key /当前键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我使用最新版本的Google服务和库(9.0.0)升级了项目,因此我遇到了这个奇怪的问题:

p>

成绩控制台:

 :app:processDebugGoogleServices 
解析json文件:/Users/cyrilmorales/Documents/Projects/mobilemeans-punainenristi/app/google-services.json
:app:processDebugGoogleServices FAILED
错误:执行任务':app:processDebugGoogleServices'失败。
>缺少api_key / current_key对象
信息:BUILD FAILED

build.gradle(root):

 依赖关系{
classpath'com.android.tools.build:gradle:2.2.0-alpha1'
classpath'com.google.gms:google-services:3.0.0'
}

build.gradle(app):

 依赖关系{
....
compile'c​​om。 google.android.gms:play-services-analytics:9.0.0'
compile'c​​om.google.android.gms:play-services-gcm:9.0.0'
compile'c​​om.google。 android.gms:play-services-maps:9.0.0'
compile'c​​om.google.android.gms:play-services-location:9.0.0'
...
}
apply plugin:'com.google.gms.google-services'

然而,它适用于8.4.0和google-services 2.1.0中的播放服务库。

您对解决方案有任何想法吗?

解决方从 https://developers.google.com/cloud-messaging/android/client#get-config



新配置文件api_key:[{current_key:XXX}] 在客户端部分

更新:或在开发人员控制台中手动启用服务并生成密钥。


Since I upgraded the project with the latest version of google services and libraries (9.0.0), I have this strange issue :

Grade console :

: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 (root) :

dependencies {
    classpath 'com.android.tools.build:gradle:2.2.0-alpha1'
    classpath 'com.google.gms:google-services:3.0.0'
}

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'

However, it works well with the play service libraries in 8.4.0 and google-services 2.1.0

Do you have any idea of the solution ?

解决方案

Generate new config file (google-services.json) from: https://developers.google.com/cloud-messaging/android/client#get-config

Newly config file with "api_key": [ { "current_key": XXX } ] in client section

Update: or manually enabled service in developer console and generate key.

这篇关于Google服务3.0.0版缺少api_key /当前键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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