ReallySmallSoftware / cordova-plugin-firebase-crashlytics

Google Firebase Crashlytics Cordova plugin
Other
33 stars 80 forks source link

Cannot add extension with name 'crashlytics', as there is an extension already registered with that name. #13

Closed therepo90 closed 5 years ago

therepo90 commented 5 years ago

Steps to Reproduce the Problem

cordova build android

Specifications

therepo90 commented 5 years ago

Its already implemented in google-firebase-plugin

LiamKarlMitchell commented 5 years ago

So how to fix it?

Akankshaagrawal13 commented 5 years ago

how we can solve that error

therepo90 commented 5 years ago

Just use only google-firebase-plugin or cordova-plugin-firebase-crashlytics :) That's it

Mahesh1433 commented 5 years ago

how

darrensapalo commented 4 years ago

Your problem is that your plugins have conflicts with each other (two different plugins trying to initialize the same functionality which is crashlytics). Just use one plugin (that manages all the plugins that need to be applied), instead of trying to orchestrate all of it.

How to use only one plugin

Assuming you wanted to use only the google-firebase-plugin:

  1. Ensure your package.json uses the dependency google-firebase-plugin only. You do this by checking the dependencies property and the devDependencies property. You should not find any cordova-plugin-firebase-crashlytics. If you find any entries, delete that line.
  2. Run npm install to make sure you have all the dependencies you need.
  3. Run cordova plugin remove cordova-plugin-firebase-crashlytics to inform cordova you will not be using it anymore. This updates your package.json too. If this throws an error that you don't have that plugin, then that is good news- there's nothing to remove.
  4. On your plugins folder, delete the folder named cordova-plugin-firebase-crashlytics. Otherwise, if that folder was still in your plugins folder, then it will be copied into your platforms/android project folder.
  5. If you are sure you did not modify any of the generated files under the platforms/ and plugins/ folder, then you can also just rm -rf platforms and rm -rf plugins which deletes the whole platforms folder. After doing so, re-add your platforms using cordova platform add android and cordova platform add ios or whichever platforms you support. By re-adding your platforms, cordova will reproduce the platforms/ and plugins/ folder.

Personally, I recommend using the Firebase X plugin instead of the google-firebase-plugin.