9/22/2023 0 Comments Flutter firebase flavorsHave you added the "google-services.json" file to the project?Į/flutter (15568): View the Android Installation documentation for more information: Į/flutter (15568): #0 MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:86:9)Į/flutter (15568): #1 Firebase.initializeApp (package:firebase_core/src/firebase.dart:43:25)Į/flutter (15568): #2 mainCommon (package:userapp/main/main_common.dart:31:18)Į/flutter (15568): #3 main (package:userapp/main/main_dev.dart:6:9)Į/flutter (15568): #4 _runMainZoned. Here's the stacktrace: E/flutter (15568): Unhandled Exception: Firebase has not been correctly initialized. TL DR When compiling to Android, Flutter App doesn't start because Firebase cannot find my google-services.json. ![]() Google/StackOverflow/FlutterFire issues all seem to misguide me to issues that have no answers for me. So my logical conclusion would be that the Flutter code is fine as well. As I mentioned, everything is working fine on iOS. I think it has something to do with the Android part not being able to find the google-services.json. The error that I'm getting doesn't bring me anywhere closer to a solution unfortunately. The issue that I'm facing has something to do with the new update. I have spent quite some time refactoring my project to conform to most breaking changes. However, now that I'm trying to get the Android part working I seem unable to start the app at all due to some Firebase issue.įlutterFire is responsible for most Firebase packages and they just released a couple updates. It's quite a big app with a lot of different functionalities (mostly google maps and firebase) that work perfectly fine on iOS. In my android/app/build.I'm a Flutter developer and for the past two days I have been trying to get my app working for Android. ![]() Here's how I set up for different flavors: I use google_mobile_ads plugin with flavors. I can have one json for production and one for development, but I cannot figure out how to put these both into the folder and how gradle will figure out which one to take according to the release flavor.Īny thoughts, hints would be greatly appreciated! Then, I have to put this file into an android/app folder of my app.Īnd this is where I found a bummer - basically, I can create json file for each of the app flavor, i.e. To do so, I made Firebase app into my Firebase account and downloaded corresponding google-services.json file required for authentication. Now, I decided to add a firebase_admob plugin to the app. ![]() The essential part of this lays into app/adle file and looks like that: flavorDimensions "flutter-flavours"Īs a result, when I build let's say development release, I have got it with following appId -, while my production release is. I have my flutter app setup to use flavors for different releases e.g.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |