Ionic Cordova构建android在:processDebugGoogleServices失败,原因是“未找到包名称'io.ionic.starter'的匹配客户端”

时间:2019-01-21 13:08:21

标签: android cordova ionic-framework ionic3

我正在使用Ionic框架来构建移动应用程序。
当我要完成应用程序时,构建失败。
输出如下所示。

Parsing json file: /Users/plum/Documents/Projects/bci-project/app/platforms/android/google-services.json
:processDebugGoogleServices FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugGoogleServices'.
> No matching client found for package name 'io.ionic.starter'

google.services.json,位置如下:

{
  "project_info": {
    "project_number": "123",
    "firebase_url": "https://cordova-plugin-firebase.firebaseio.com",
    "project_id": "cordova-plugin-firebase",
    "storage_bucket": "cordova-plugin-firebase.appspot.com"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "1:123:android:123",
        "android_client_info": {
          "package_name": "com.github.cordova_plugin_firebase"
        }
      },
      "oauth_client": [
        {
          "client_id": "123.apps.googleusercontent.com",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "123"
        }
      ],
      "services": {
        "analytics_service": {
          "status": 1
        },
        "appinvite_service": {
          "status": 1,
          "other_platform_oauth_client": []
        },
        "ads_service": {
          "status": 2
        }
      }
    }
  ],
  "configuration_version": "1"
}

我试图编辑google.services.json来更改软件包名称以与config.xml匹配,但是当我再次构建时,google.services.json回到了以前的样子。

1 个答案:

答案 0 :(得分:0)

尝试使用正确的程序包名称将google-services.json复制到项目的根文件夹中,然后进行构建。 也许您需要再次删除并添加android平台