Cordova-plugin-firebase: When google-services.json already exists in platforms/android it wont install

Created on 11 Aug 2017  路  6Comments  路  Source: arnesson/cordova-plugin-firebase

Apparently it tries to create a new emtpy google-services.json on install, but when you already have google-services.json in your platforms/android directory it won't install.

Command was via cordova: ionic cordova plugin add cordova-plugin-firebase on an ionic1 project.

Not hard to solve, just enter platforms/android and delete google-services.json.

But I think plugin should check for existence of google-services.json and do nothing in that case.

Cheers!

Error here

ERROR] An error occurred while running cordova plugin add cordova-plugin-firebase --save (exit code 1):

        Installing "cordova-plugin-firebase" for android
        Error during processing of action! Attempting to revert...
        Failed to install 'cordova-plugin-firebase': CordovaError: Uh oh!
        "/Users/id/Documents/my-project/platforms/android/google-services.json"
        already exists!
        at copyNewFile
        (/Users/id/Documents/my-project/platforms/android/cordova/lib/pluginHandlers.js:248:15)
        at install
        (/Users/id/Documents/my-project/platforms/android/cordova/lib/pluginHandlers.js:43:17)
        at Object.process
        (/Users/id/Documents/my-project/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)
        at PluginManager.doOperation
        (/Users/id/Documents/my-project/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:117:20)
        at PluginManager.addPlugin
        (/Users/id/Documents/my-project/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:147:17)
        at /Users/id/Documents/my-project/platforms/android/cordova/Api.js:254:18
        at _fulfilled
        (/Users/id/Documents/my-project/platforms/android/cordova/node_modules/q/q.js:854:54)
        at self.promiseDispatch.done
        (/Users/id/Documents/my-project/platforms/android/cordova/node_modules/q/q.js:883:30)
        at Promise.promise.promiseDispatch
        (/Users/id/Documents/my-project/platforms/android/cordova/node_modules/q/q.js:816:13)
        at
        /Users/id/Documents/my-project/platforms/android/cordova/node_modules/q/q.js:570:49
        Error: Uh oh!
        "/Users/id/Documents/my-project/platforms/android/google-services.json"

Most helpful comment

I am having the same issue.

All 6 comments

I will take a PR to fix this. sort of related: https://github.com/arnesson/cordova-plugin-firebase/pull/391 it could be moved to the prepare hook

Is this supposed to be fixed, because it is still happening to me ...
Failed to install 'cordova-plugin-firebase': CordovaError: Uh oh!
"...\platforms\androidgoogle-services.json" already exists!

I am having the same issue.

I am having same issue, I am using bitrise.io for building my ionic app and I have exactly same issue:

Failed to install 'cordova-plugin-firebase': CordovaError: Uh oh!
...platforms/android/google-services.json" already exists!

But there is always clean build.. How can I solve this issue?

Closing for cleanup. Please test with the latest version and reopen if it is still an issue.

Was this page helpful?
0 / 5 - 0 ratings