NativeScript + Firebase, new firebase project is not being picked up

111 Views Asked by At

I am working with Master Detail with Firebase Angular template, and I can successfully build the app locally.

But then when I try to reconfigure the app for my own firebase project, nothing seems to change. It continues to query the default app's firebase.

I have followed the instructions for changing firebase app to my own to the letter but I cannot figure out why it still keeps pointing to the old app.

These are the steps I take to change the firebase app:

  1. I create an App in Firebase, using the app id from package.json.
  2. I download google-services.json and copy it to App_Resources/Android/google-services.json
  3. Additionally, I delete google-services.json from platforms/android/app, just in case.
  4. I uninstall the previously installed App from the emulator. I event deleted and created a new emulator to make sure there are no remnants of the previously built app.
  5. I search all the files in the project for any reference for https://car-rental-b26b7.firebaseio.com which is the default firebase app that comes with the template, and I don't find anything at all.
  6. I also edited firebase.common.ts with the following upon successful initialisation:

    .then((instance) => console.log("firebase.init done", instance),

Just to see which project its initialising. 7. Finally, I build: tns run android

And sure enough, the console log shows https://car-rental-b26b7.firebaseio.com as the project being initialised.

I know for definite it is copying the new project's google-services.json over to platforms/android/app, because when I deleted the file it refused to build, as expected. Placing the file back, it builds successfully.

But I have no idea why it continues to reference the original firebase project.

Has anyone come across something similar?

0

There are 0 best solutions below