phonegap / phonegap-plugin-push

Register and receive push notifications
MIT License
1.94k stars 1.91k forks source link

No matching client after installing phonegap push plugin in ionic #2731

Open veronesecoms opened 5 years ago

veronesecoms commented 5 years ago

My application works normally before i installing phonegap push plugin in my ionic project.

After i install this package and make a ionic cordova run android i receive:

BUILD FAILED in 6s cmd: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

My google-services.json is replace by this archive every time i make a ionic cordova run android:

{
  "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"
}

When i change the package-name for the name that have in my config.xml widtget and run ionic cordova run android again, the package-name is replace to com.github.cordova_plugin_firebase every time i run ionic cordova run android... How i can fix this?

My cordova plugin ls:

> cordova plugin ls
at.gofg.sportscomputer.powermanagement 1.1.0 "PowerManagement"
cordova-plugin-advanced-http 1.11.1 "Advanced HTTP plugin"
cordova-plugin-app-event 1.2.1 "Application Events"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-background-mode 0.7.2 "BackgroundMode"
cordova-plugin-badge 0.8.7 "Badge"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-ionic-keyboard 2.1.2 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-local-notifications-db 0.8.4 "LocalNotification"
cordova-plugin-sim 1.3.3 "SIM"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 2.4.0 "Cordova sqlite storage plugin"
cordova-support-google-services 1.1.0 "cordova-support-google-services"
phonegap-plugin-multidex 1.0.0 "Multidex"
phonegap-plugin-push 2.2.3 "PushPlugin"

cordova --version 8.0.0

cordova platform version android Installed platforms: android 7.1.0 ios 4.5.5 Available platforms: browser ~5.0.1 osx ~4.0.1 windows ~5.0.0 www ^3.12.0

cordova plugin version

cordova-plugin-advanced-http 1.11.1 "Advanced HTTP plugin" cordova-plugin-app-event 1.2.1 "Application Events" cordova-plugin-app-version 0.1.9 "AppVersion" cordova-plugin-background-mode 0.7.2 "BackgroundMode" cordova-plugin-badge 0.8.7 "Badge" cordova-plugin-device 2.0.2 "Device" cordova-plugin-dialogs 2.0.1 "Notification" cordova-plugin-file 6.0.1 "File" cordova-plugin-firebase 2.0.5 "Google Firebase Plugin" cordova-plugin-ionic-keyboard 2.1.2 "cordova-plugin-ionic-keyboard" cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview" cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification" cordova-plugin-local-notifications-db 0.8.4 "LocalNotification" cordova-plugin-sim 1.3.3 "SIM" cordova-plugin-splashscreen 5.0.2 "Splashscreen" cordova-plugin-whitelist 1.3.3 "Whitelist" cordova-sqlite-storage 2.4.0 "Cordova sqlite storage plugin" cordova-support-google-services 1.1.0 "cordova-support-google-services" phonegap-plugin-multidex 1.0.0 "Multidex" phonegap-plugin-push 2.2.3 "PushPlugin"

ionic version 4.1.1

ng version

Angular CLI: 6.0.8
Node: 8.11.3
OS: win32 x64
Angular: 5.2.11
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         <error>
@angular-devkit/build-optimizer   0.0.35
@angular-devkit/core              <error>
@angular-devkit/schematics        <error>
@angular/http                     6.1.10
@schematics/angular               <error>
@schematics/update                <error>
rxjs                              5.5.11
typescript                        2.6.2
webpack                           3.12.0
victorpacheco3107 commented 4 years ago

Try this, work for me:

  1. ionic cordova platform rm android
  2. Copy the correct google-services.json in your project's root folder
  3. ionic cordova platform add android

Happy coding!