【问题标题】:Execution failed for task ':app:processDebugGoogleServices'. > No matching client found for package name 'com.example.myapp '任务“:app:processDebugGoogleServices”执行失败。 > 找不到与包名称“com.example.myapp”匹配的客户端
【发布时间】:2021-06-20 07:18:42
【问题描述】:
  • 出了什么问题: 任务“:app:processDebugGoogleServices”执行失败。

找不到与包名称“com.example.myapp”匹配的客户端

  • 尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。

这是来自 Google Service.json 的客户端部分

“客户端”:[https://stackoverflow.com/questions/66766493/execution-failed-for-task-appprocessdebuggoogleservices-no-matching-clien {

  "client_info": {

"mobilesdk_app_id": "1:110944006455:android:f790b09ad0563a63046ab2",
"android_client_info": {
  "package_name": "com.example.myapp"
}
}

这是我的 build.gradle

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.riderapp "
    minSdkVersion 16
    targetSdkVersion 28
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}

您可以看到两者的应用程序 ID 相同。 然而我收到了这个错误:

  • 出了什么问题: 任务 :app:processDebugGoogleServices 执行失败

找不到与包名称“com.example.myapp”匹配的客户端

【问题讨论】:

  • 你在 build.gradle 中实现了 google 服务吗?类路径 'com.google.gms:google-services:4.3.4'

标签: android ios firebase flutter dart


【解决方案1】:

两者的应用程序 ID 不同。在谷歌服务 json 它说com.example.myapp

但在你的 buildGradle 中是 com.example.riderapp

转到 firebase,使用 buildGradle com.example.riderapp 中使用的名称再次添加您的应用,在此步骤中也将您的 SHA-1 调试密钥添加到 firebase,然后再次下载您的 json 并删除旧的。并报告发生了什么。

注意:确保保持新的 googlejson 准确命名为 google-services.json

【讨论】:

    【解决方案2】:

    在 app/build.gradle 中将 minSdkVersion 更改为 21 并将项目中的每个 'com.example.anything' 更改为您的项目 ID(您可以在 firestore 的项目详细信息中找到它)

    【讨论】:

      猜你喜欢
      • 2018-11-14
      • 2016-06-22
      • 1970-01-01
      • 2016-04-13
      • 2019-06-19
      • 1970-01-01
      • 1970-01-01
      • 2020-10-19
      相关资源
      最近更新 更多