![]() And since the documentation for FlutterFire CLI is quite bare-bones, I have written this guide to cover all the setup steps. Flavor means enhancing an apps core code with features resulting in different versions of the same app (just to mention the most common examples: free/paid. NOTE: It may be a bit misleading to use firebase instances identified as dev and live environment but in our case are two separate instances of the backend. Build variants: a build variant is the cross product of flavors and types. I use google_mobile_ads plugin with flavors. This is made possible by the new FlutterFire CLI tool, which can generate the correct Firebase configuration for our project. Product flavors: a flavor is a different version of the app, like free and paid. 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. The interesting part of android/app/build.I have my flutter app setup to use flavors for different releases e.g. > Keystore file not set for signing config release On building time we experienced the following error.Įxecution failed for task ':app:validateSigningUatRelease'. App flavors allow us to create multiple versions of our app with the same codebase, making it easy to create and test new features without the risk of destroying production data. How we implemented flavors is very similar to the guides linked in Flutter documentation.Īfter having development and uat working, we added signing for release, following the official guide, and at that point, Android uat stopped working. ![]() I would like to use a different Firebase project for each flavor so that the data for each flavor is kept separate. release connects to a production Firebase project, it is signed for store distribution. I have a Flutter app with three different flavors: development, staging, and production.Both apps can be installed on the device now and they can run in parallel. flutter run -flavor dev or flutter run -flavor prod. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |