由于我使用最新版本的谷歌服务和库(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.
这篇关于Google 服务 3.0.0 缺少 api_key/current 密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 IncompIncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 Incompatible
如何在 gradle 中获取当前风味How to get current flavor in gradle(如何在 gradle 中获取当前风味)
如何修复“意外元素<查询>在“清单How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修复“意外元素lt;查询gt;在“清单中找到错误
基于 Android Gradle 中多风味库的多风味应用Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多风味库的多风味应用)
Android 依赖在编译和运行时有不同的版本Android dependency has different version for the compile and runtime(Android 依赖在编译和运行时有不同的版本)
本地 aar 库的传递依赖Transitive dependencies for local aar library(本地 aar 库的传递依赖)