Cordova-plugin-fcm-with-dependecy-updated plugin

Hi Ionic team. We faced with the problem we can’t make android build work with this plugin: cordova-plugin-fcm-with-dependecy-updated. But we need this plugin to add push notifications functionality to our app. Please suggest a solution.

Can you please share your error log for android build?

Configure project :app
FCM PLUGIN GRADLE TOOLS VERSION: 3.5.0google-services.json not found, google-services plugin not applied. Push Notifications won’t work
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/debug]

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ‘:app’.

org.gradle.api.internal.tasks.DefaultTaskContainer$DuplicateTaskException: Cannot add task ‘processDebugGoogleServices’ as a task with that name already exists.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

CONFIGURE FAILED in 0s
Cannot add task ‘processDebugGoogleServices’ as a task with that name already exists.

You haven’t included google-services.json in your project as it is clearly mentioned in your error.
Copy google-services.json to \platforms\android .

We did like you suggested


Here you can see our /platforms/android folder with google.services.json included, then rebuild app using “npx cap add android” (previously we removed android folder) but we still have errors in console:

Configure project :app
FCM PLUGIN GRADLE TOOLS VERSION: 3.5.0google-services.json not found, google-services plugin not applied. Push Notifications won’t work
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/debug]

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ‘:app’.

org.gradle.api.internal.tasks.DefaultTaskContainer$DuplicateTaskException: Cannot add task ‘processDebugGoogleServices’ as a task with that name already exists.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

CONFIGURE FAILED in 7s
Cannot add task ‘processDebugGoogleServices’ as a task with that name already exists.

But a bit strange for us is the fact we didn’t have android folder in folder platforms and created It by ourselves

This folder appears only after command “cordova platform add android”, but we use capacitor, and in case with cordova folder if we try to run build from there we have another error:
error: failed linking file resources.