My client has recently changed their Firebase instance (meaning its under a different project, in a different google sign on). I.e. they have a new instance that they want to use for production. I created the new instance and project with a different name to avoid any confusion. So for Android i removed the old google-services.json and downloaded the new one from Firebase and copied it into the android/app directory. Then I reviewed the project level and app level gradel files. No problems there. I checked inside the new google-services.json file and can clearly see that it is pointing to the new instance of Firebase.
Here's a snippet below:
"project_info": {
"project_number": "506498949424",
"firebase_url": "https://lbds-aeb3d.firebaseio.com",
"project_id": "lbds-aeb3d",
"storage_bucket": "lbds-aeb3d.appspot.com"
},
The old name was LittleBigDeals instead of lbds.
Actually this process has worked fine for the IOS side of the project. The app is now pointing at the new database.
However when I install it on ANdroid it still retrieves data from the old database.
Is there a pointer I'm missing or that I need to refresh in the Android set up.
Any help with this would be greatly appreciated.
Many thanks.
I had this same issue yesterday. I had changed to a different Firebase project in my Flutter app. iOS worked fine but Android still was attempting to use the incorrect Firebase project, despite google-services.json clearly pointing to the new project. The issue appeared to be limited to my local machine but was very bizarre and annoying. Another developer suggested that I try the "flutter clean" command, and once I ran flutter clean and re-started the virtual Android device, it then used the correct Firebase instance.
Related
I'm creating an app using react native and firebase messaging. Some time ago I created development firebase project and now I have to switch it to another project, but there is a problem. I created new project and changed google-services.json file in /android/app and it seems to take correct values from this file, because they are in /android/app/build/generated/res/google-services/debug/values/values.xml, but even though the values seems correct, the messaging works only with previous project, notifications from new project are not received. The configuration for both firebase projects seems almost identical and I have no clue how to fix that. I already tried deleting build directory from /android/app and running app with npm run android --reset-cache but it did nothing. Any ideas on what is the cause for that?
I have two firebase project, one for dev and one for my live environment.
The same goes for the android configuration, one "dev" and one "live" environment.
Now im trying to use the flutter Firebase Admob package.
Each environment has a different app id like com.myapp.dev and com.myapp.live
I think on the app mob site only com.myapp.live is available. Do I need as well here two configs or can't I just show test ads without it?
Or how the connection works?
If I copy the Admob app id (probably related to com.myapp.live?) and use it in the android manifest under the main and/or the "dev" env folder I get always an error that Admob is not configured correctly.
Every other firebase service works fine with the google.services split-up in the different env folders.
EDIT:
I created a new Admob entry for com.myapp.dev, linked it with firebase and it still not work when im using the new Admob app id.
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:
I create an App in Firebase, using the app id from package.json.
I download google-services.json and copy it to App_Resources/Android/google-services.json
Additionally, I delete google-services.json from platforms/android/app, just in case.
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.
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.
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?
I have moved my Flutter App in Firebase from one Project to another new Project and replaced previous google-services.json with the new one. Then I tried the App it was still connected to the previous project, all data was created in the old project, even if I have deleted the app from the old project. I couldn't find a solution to fix it so I deleted the old firebase project and cleared all caches. Then the App started to return API is Invalid errors. I made sure that I dont have any multiple files or they API is written somewhere else a well. without the new google-services.json it returns the error No API Key was found so it seems to be right placed.
I ran out of ideas how to fix it. Did I miss anything?
SOLVED
I was having the same error and I solved it by deleting the build folder and then running flutter package
The only way to solve it was to change my package name and create a new App in my project. I guess the problem is internal at firebase that the old app didn't get properly deleted in the previous project.
my app is working well on my first phone in which I used to run tests. But it crashed after uploading on Play store and used in another phone. Why does this happen? [firebase]
I had changed the package name of the app in source code. So I added a new app on Firebase and used it's json source file too
I can sign in successfully but then it crashes
I know this is old, but i experienced this issue and solved it by setting minified enabled to false in gradle.
Apparently this only got to happen when i upload the apk to appstore, was using firebase 9.6.0.