android - 找不到包名称 processAppDebugGoogleServices 的匹配客户端

标签 android android-productflavors google-play-services

我已经尝试了 Stack Overflow 上几乎所有相关的解决方案。 但是问题还是没有解决。

Error: Execution failed for task ':App:processAppDebugGoogleServices'.
> No matching client found for package name 'com.example.application'

设置.gradle:

include ':App'

这是 list 代码:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.application"
    android:versionCode="17"
    android:versionName="1.17">

这是应用程序级别的 Gradle 依赖项:

classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:2.0.0-alpha3'

问题:flavor1,即应用程序,正在生成错误,而 application_rtl 工作正常。

最佳答案

如果应用程序使用 Google 服务但没有为应用程序的 applicationId (packageName) 正确配置“google-services.json”文件,则会生成“找不到匹配的客户端...”消息。

确认您的项目有一个“google-services.json”文件,其中包含一个“android_client_info” block ,其中“package_name”为“com.example.application”。

寻找一个看起来像这样的 block :

"client_info": {
     "mobilesdk_app_id":"1:12345678901:android:876a5bc432109d87”, 
     "android_client_info": {
          "package_name": "com.example.application”
     }
}

并验证它是正确的。可能最好的做法就是从 Firebase 控制台生成一个新的、正确的 google-services.json 文件。

参见:https://firebase.google.com/docs/android/setup

关于android - 找不到包名称 processAppDebugGoogleServices 的匹配客户端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36444486/

相关文章:

android - 无法解析符号 'LocationRequest' Android 项目

Android VKontake 官方客户端。如何获得授权

c# - Xamarin 中的 ListView 错误

Android Studio 1.0.1 中的 Android 注释和风格

具有不同依赖项和相同类文件的 Android 风格

java - 无法从播放服务获取位置更新

android - 与 Android 4.0.4 不兼容的 Google Play 服务

android - Android-L 有哪些新的嵌套滚动 API?

android - 带按钮的表格布局 - 第一个按钮 (1x1) 的背景大小在屏幕上与其他按钮不同(所有按钮使用相同的图像)

android - 如何仅在应用的一个版本中展示广告