简体   繁体   中英

FLUTTER FIREBASE Change to new instance not working for Android

My client has recently changed their Firebase instance (meaning its under a different project, in a different google sign on). Ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM