Cannot add task 'processDebugGoogleServices' as a task with that name already exists

What works for me was changing the line:

apply plugin: com.google.gms.googleservices.GoogleServicesPlugin

in platforms\android\cordova-plugin-fcm-with-dependecy-updated

to this:

ext.postBuildExtras = {
    apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
}

I've had several issues with the plugin as well including the one you mention above. My problem was that my platforms/android/src/build.gradle, for some unknown reason, had duplicate dependencies (com.google.firebase:firebase-messaging & com.google.firebase:firebase-core) after removing the duplicates everything worked fine. Hope this helps!


I removed {phonegap-plugin-push": "2.2.3",} from my package.json.

my "package.json" was ..

{
"name": "TaxMan_v2",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
  "scripts": {
   "ng": "ng",
   "start": "ng serve",
   "build": "ng build",
   "test": "ng test",
   "lint": "ng lint",
   "e2e": "ng e2e"
 },
"private": true,
"dependencies": {
  "@angular/common": "^7.2.2",
  "@angular/core": "^7.2.2",
  "@angular/forms": "^7.2.2",
  "@angular/http": "^7.2.2",
  "@angular/platform-browser": "^7.2.2",
  "@angular/platform-browser-dynamic": "^7.2.2",
  "@angular/router": "^7.2.2",
  "@ionic-native/core": "^5.0.0",
  "@ionic-native/splash-screen": "^5.0.0",
  "@ionic-native/status-bar": "^5.0.0",
  "@ionic/angular": "^4.0.0",
  "@ionic/storage": "^2.2.0",
  "chart.js": "^2.7.3",
  "cordova-android": "7.1.4",
  "cordova-plugin-device": "2.0.2",
  "cordova-plugin-fcm-with-dependecy-updated": "2.4.0",
  "cordova-plugin-ionic-keyboard": "^2.0.5",
  "cordova-plugin-ionic-webview": "^3.0.0",
  "cordova-plugin-ms-azure-mobile-apps": "^2.0.2",
  "cordova-plugin-splashscreen": "5.0.2",
  "cordova-plugin-statusbar": "2.4.2",
  "cordova-plugin-whitelist": "^1.3.3",
  "cordova-support-google-services": "1.1.0",
  "core-js": "^2.5.4",
  "phonegap-plugin-multidex": "1.0.0",
  "phonegap-plugin-push": "2.2.3",
  "rxjs": "~6.3.3",
  "zone.js": "~0.8.29"
},
"devDependencies": {
  "@angular-devkit/architect": "~0.12.3",
  "@angular-devkit/build-angular": "~0.12.3",
  "@angular-devkit/core": "~7.2.3",
  "@angular-devkit/schematics": "~7.2.3",
  "@angular/cli": "~7.2.3",
  "@angular/compiler": "~7.2.2",
  "@angular/compiler-cli": "~7.2.2",
  "@angular/language-service": "~7.2.2",
  "@ionic/angular-toolkit": "~1.2.0",
  "@types/node": "~10.12.0",
  "@types/jasmine": "~2.8.8",
  "@types/jasminewd2": "~2.0.3",
  "codelyzer": "~4.5.0",
  "jasmine-core": "~2.99.1",
  "jasmine-spec-reporter": "~4.2.1",
  "karma": "~3.1.4",
  "karma-chrome-launcher": "~2.2.0",
  "karma-coverage-istanbul-reporter": "~2.0.1",
  "karma-jasmine": "~1.1.2",
  "karma-jasmine-html-reporter": "^0.2.2",
  "protractor": "~5.4.0",
  "ts-node": "~8.0.0",
  "tslint": "~5.12.0",
  "typescript": "~3.1.6"
},
"description": "An Ionic project",
"cordova": {
  "plugins": {
    "cordova-plugin-whitelist": {},
    "cordova-plugin-statusbar": {},
    "cordova-plugin-device": {},
    "cordova-plugin-splashscreen": {},
    "cordova-plugin-ionic-webview": {},
    "cordova-plugin-ionic-keyboard": {},
    "cordova-plugin-fcm-with-dependecy-updated": {}
  },
  "platforms": [
    "android"
    ]
  }
}

Tags:

Ionic4