2
votes

I'm building a fresh new application from npm with the following plugins and commands

  • cordova create prh com.demo.prj hello
  • cordova plugin add cordova-plugin-fcm
  • cordova plugin add cordova-plugin-firebase -> put my : google-services.json on root dir
  • cordova build android .

This is the error displayed:

Error: cmd: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':mergeDebugResources'. [string/google_api_key] C:\Users\user\Cproj\platforms\android\res\values\strings.xml [string/google_api_key] C:\Users\user\Cproj\platforms\android\build\generated\res\google-services\debug\values\values.xml: Error: Duplicate resources [string/google_app_id] C:\Users\user\Cproj\platforms\android\res\values\strings.xml [string/google_app_id] C:\user\Cproj\platforms\android\build\generated\res\google-services\debug\values\values.xml: Error: Duplicate resources

  • I've tried to delete the duplicate values on android\res\values\strings.xml but on each build its coming back and display the same error .

  • Is this is currect way to build a cordova based application with fire bash push notification service ?

Thanks .

1
Hello, did anyone got the workaround for it? - Kunal Kakkad
No. ended up using only the fcm plugin - fatalica

1 Answers

1
votes

I went through the same problem, in my case, I just removed the Firebase dependencies from the build.gradle files and the build worked perfectly.

See my answer