問(wèn)題描述
由于我使用最新版本的谷歌服務(wù)和庫(kù)(9.0.0)升級(jí)了項(xiàng)目,我遇到了這個(gè)奇怪的問(wèn)題:
Since I upgraded the project with the latest version of google services and libraries (9.0.0), I have this strange issue :
等級(jí)控制臺(tái):
: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(應(yīng)用程序):
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 中的播放服務(wù)庫(kù)配合使用
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
更新:或在開(kāi)發(fā)者控制臺(tái)中手動(dòng)啟用服務(wù)并生成密鑰.
Update: or manually enabled service in developer console and generate key.
這篇關(guān)于Google 服務(wù) 3.0.0 缺少 api_key/current 密鑰的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!