Skip to content

Plugin conflicting with Firebase plugins #58

@sagrawal31

Description

@sagrawal31

Description

Wondering, if this CleverTap Cordova plugin works with Firebase plugins?

I'm using the latest versions of:

  1. https://github.com/chemerisuk/cordova-plugin-firebase-messaging
  2. https://github.com/chemerisuk/cordova-plugin-firebase-analytics
  3. https://github.com/chemerisuk/cordova-plugin-firebase-crash

Our build without this plugin is working fine but as soon as, we are installing this one, we are getting the following errors:

> Task :app:generateDebugResValues
> Task :app:generateDebugResources
> Task :app:injectCrashlyticsMappingFileIdDebug
> Task :app:writeDebugApplicationId

> Task :app:processDebugGoogleServices
Parsing json file: /Users/shashank/Projects/onmobile/kids-app/mobile-app/platforms/android/app/google-services.json

> Task :app:mergeDebugResources FAILED
[string/google_app_id] /Users/shashank/Projects/onmobile/kids-app/mobile-app/platforms/android/app/src/main/res/values/strings.xml	[string/google_app_id] /Users/shashank/Projects/onmobile/kids-app/mobile-app/platforms/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources
[string/google_api_key] /Users/shashank/Projects/onmobile/kids-app/mobile-app/platforms/android/app/src/main/res/values/strings.xml	[string/google_api_key] /Users/shashank/Projects/onmobile/kids-app/mobile-app/platforms/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> [string/google_app_id] /Users/shashank/Projects/onmobile/kids-app/mobile-app/platforms/android/app/src/main/res/values/strings.xml	[string/google_app_id] /Users/shashank/Projects/onmobile/kids-app/mobile-app/platforms/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources
  [string/google_api_key] /Users/shashank/Projects/onmobile/kids-app/mobile-app/platforms/android/app/src/main/res/values/strings.xml	[string/google_api_key] /Users/shashank/Projects/onmobile/kids-app/mobile-app/platforms/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources

* 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

BUILD FAILED in 7s
23 actionable tasks: 23 executed
/Users/shashank/Projects/onmobile/kids-app/mobile-app/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> [string/google_app_id] /Users/shashank/Projects/onmobile/kids-app/mobile-app/platforms/android/app/src/main/res/values/strings.xml	[string/google_app_id] /Users/shashank/Projects/onmobile/kids-app/mobile-app/platforms/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources
  [string/google_api_key] /Users/shashank/Projects/onmobile/kids-app/mobile-app/platforms/android/app/src/main/res/values/strings.xml	[string/google_api_key] /Users/shashank/Projects/onmobile/kids-app/mobile-app/platforms/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources

* 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

BUILD FAILED in 7s

We have been trying hard on this issue for the last 4 days but couldn't get it functional. We even looked at the issues of this plugin but couldn't find anything related exception this.

I know this is something related to google-services.json file which is being copied two times. One is being used by after plugin install hook and other is being copied by our config.xml i.e. <resource-file src="google-services.json" target="app/google-services.json" /> which is required for Cordova Firebase plugin.

Environment

Ionic:

   Ionic CLI          : 6.5.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework    : ionic-angular 3.9.5
   @ionic/app-scripts : 3.2.3

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.3, (and 24 other plugins)

Utility:

   cordova-res (update available: 0.13.0) : 0.5.1
   native-run (update available: 1.0.0)   : 0.3.0

System:

   Android SDK Tools : 26.1.1 (/Users/shashank/Library/Android/sdk)
   ios-deploy        : 1.10.0
   ios-sim           : 8.0.2
   NodeJS            : v10.16.0 (/usr/local/bin/node)
   npm               : 6.9.0
   OS                : macOS Catalina
   Xcode             : Xcode 11.2.1 Build version 11B500

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions