Failed to install 'cordova-plugin-firebase': CordovaError: Uh oh! "../colors.xml" already exists!

I am trying to install the cordova-plugin-firebase in my ionic app but it’s not working
I have cordova-android version 11
When I try to install the plugin it says

Installing “cordova-plugin-firebase” for android
Error during processing of action! Attempting to revert…
Failed to install ‘cordova-plugin-firebase’: CordovaError: Uh oh!
“C:\Users\Asus\Desktop\project\platforms\android\app\src\main\res\values\colors.xml” already exists!
at copyNewFile (C:\Users\Asus\Desktop\project\node_modules\cordova-android\lib\pluginHandlers.js:231:45)
at install (C:\Users\Asus\Desktop\project\node_modules\cordova-android\lib\pluginHandlers.js:34:17)
at ActionStack.process (C:\Users\Asus\Desktop\project\node_modules\cordova-common\src\ActionStack.js:56:25)
at PluginManager.doOperation (C:\Users\Asus\Desktop\project\Asus\Desktop\project\node_modules\cordova-common\src\PluginManager.js:142:21)
at C:\Users\Asus\Desktop\project\node_modules\cordova-android\lib\Api.js:155:78
Uh oh!
“C:\Users\Asus\Desktop\project\platforms\android\app\src\main\res\values\colors.xml” already exists!
at processTicksAndRejections (internal/process/task_queues.js:93:5)
[ERROR] An error occurred while running subprocess cordova.

here’s my cordova plugin list

cordova plugin list
cordova-plugin-actionsheet 2.3.3 “ActionSheet”
cordova-plugin-android-native-pdfviewer 0.0.1 “AndroidNativePdfViewer”
cordova-plugin-android-permissions 1.0.2 “Permissions”
cordova-plugin-badge 0.8.8 “Badge”
cordova-plugin-camera 4.1.0 “Camera”
cordova-plugin-compat 1.2.0 “Compat”
cordova-plugin-console 1.1.0 “Console”
cordova-plugin-device 2.0.2 “Device”
cordova-plugin-dialogs 2.0.2 “Notification”
cordova-plugin-document-viewer 0.9.13 “SitewaertsDocumentViewer”
cordova-plugin-file-opener2 3.0.0 “File Opener2”
cordova-plugin-file-transfer 2.0.0-dev “File Transfer”
cordova-plugin-file 7.0.0-dev “File”
cordova-plugin-firebase-analytics 6.0.1 “FirebaseAnalyticsPlugin”
cordova-plugin-firebase-authentication 5.0.0 “cordova-plugin-firebase-authentication”
cordova-plugin-firebase-messaging 6.0.0 “FirebaseMessagingPlugin”
cordova-plugin-firebase 0.1.24 “Google Firebase Plugin”
cordova-plugin-inappbrowser 4.0.0 “InAppBrowser”
cordova-plugin-ionic-webview 4.1.2 “cordova-plugin-ionic-webview”
cordova-plugin-local-notification 0.9.0-beta.2 “LocalNotification”
cordova-plugin-network-information 2.0.2 “Network Information”
cordova-plugin-preview-any-file 0.1.6 “PreviewAnyFile”
cordova-plugin-qrscanner 3.0.1 “QRScanner”
cordova-plugin-statusbar 2.4.3 “StatusBar”
cordova-sms-plugin 1.0.1 “Cordova SMS Plugin”
cordova-support-android-plugin 1.0.2 “cordova-support-android-plugin”
integrator-cordova-plugin-downloader 0.0.1 “Downloader”
ionic-plugin-keyboard 2.2.1 “Keyboard”
mx.ferreyra.callnumber 0.0.2 “Cordova Call Number Plugin”

any idea please?

cordova-android added a colors.xml file, so plugins that used to create that file should be updated to not do it anymore and write to it instead.

Considering the plugin has not been updated since 2019 you’ll have to fork the plugin and do the changes yourself or switch to a different plugin.

1 Like

I’ve used cordova-plugin-firebasex without problems. Have you tried “x” version?