0

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?

  • Did you try deleting platforms, hooks, node_modules folders and running the build again. How do you conform it's connecting to original project, can you share those details. – Manoj Mar 18 '20 at 14:19
  • I mention in #6 above how I confirmed it's still referring to the old Firebase project. I can delete node_modules and platforms and readd them, but hooks I believe are part of the repo? How do I re-add them if I delete them? – spinalkracker Mar 18 '20 at 14:33
  • I meant how do you justify its connected to original Firebase? Also all those folders are auto generated, when you run the tns command everything will be generated again. – Manoj Mar 18 '20 at 18:11
  • because when I initialize firebase, and put instance in console.log, it refers to the old firebase URL. Also, in my new firebase project I changed the data, but the changes are not reflected in the app, because it's still getting data from the original project. – spinalkracker Mar 20 '20 at 00:20
  • Did you try a clean build yet? If issue persists please share a sample repo. – Manoj Mar 20 '20 at 00:21

0 Answers0