I am trying to add Google Firebase notifications to my Phonegap Cordova application built with Ionic. I have already successfully installed the Google Plus plugin for login (I think this will be useful information).
I only need this Firebase plugin to complete my work, but I was stopped by this error when I created an Android application.
There was a problem setting up the root project 'android'. Cannot add task ': processDebugGoogleServices' as a task with the same name already exists.
I follow this guide to configure the Cordova Firebase Cloud Messaging plugin for Android
Here is my build.gradle file edited as stated in the lesson:
apply plugin: 'com.android.application' buildscript { repositories { mavenCentral() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.0' classpath 'com.google.gms:google-services:3.0.0' } } -------- dependencies { compile fileTree(dir: 'libs', include: '*.jar') // SUB-PROJECT DEPENDENCIES START debugCompile(project(path: "CordovaLib", configuration: "debug")) releaseCompile(project(path: "CordovaLib", configuration: "release")) compile "com.google.android.gms:play-services-plus:9.2.0" compile "com.google.android.gms:play-services-identity:9.2.0" compile "com.android.support:support-v4:+" compile "com.android.support:appcompat-v7:+" compile "com.android.support:appcompat-v7:23.2.1" compile "com.google.firebase:firebase-messaging:9.0.2" // SUB-PROJECT DEPENDENCIES END } apply plugin: 'com.google.gms.google-services'
source share