Unable to add task ': processDebugGoogleServices' as a task with the same name already exists

I want to check the Firebase FCM plugin, but it seems to have a lot of errors, after solving many of them, here's what I'm trying to do: ionic cordova build android

i have this error:

my build.gradle for android:

 dependencies {
        classpath 'com.android.tools.build:gradle:2.2.1'
        classpath 'com.google.gms:google-services:3.1.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.firebase:firebase-core:+"
    compile "com.google.firebase:firebase-messaging:+"
    compile "com.google.android.gms:play-services-maps:9.8.0"
    compile "com.google.android.gms:play-services-location:9.8.0"
    compile "com.android.support:support-v13:23+"
    compile "com.google.android.gms:play-services-gcm:11+"
    compile "me.leolin:ShortcutBadger:1.1.14@aar"
    // SUB-PROJECT DEPENDENCIES END
}
apply plugin: 'com.google.gms.google-services'

      

FCMPlugin.gradle:

 dependencies {
        classpath 'com.android.tools.build:gradle:+'
        classpath 'com.google.gms:google-services:3.1.0'
    }

      

+3


source to share


1 answer


In FCM Gradle, comment out the last line (below) containing Googleservicesplugin "\ Platforms \ Android \ Cordova-plugin-ct \ your_app-FCMPlugin.gradle"



buildscript {
repositories {
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:+'
classpath 'com.google.gms:google-services:3.0.0'
}
}
// apply plugin: 'com.google.gms.google-services' <---- COMMENT THIS LINE TOO, add to Root gradle file
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
//apply plugin: com.google.gms.googleservices.GoogleServicesPlugin <---- COMMENT THIS LINE

      

0


source







All Articles