I recently did a firebase integration in flutter to enable cloud messaging services in my app.
I guess you all know what it means.
The power of customized, fast notifications in my flutter app.
I thought being firebase and being flutter has its own perks (since both is backed by Google).
But in reality it's not that easy.
I wanted to integrate androidX support inside my android folder for the flutter app to work.
Well the official doc of integrating firebase to flutter is good(https://firebase.google.com/docs/flutter/setup), but it does not provide you with the full details though.
Apart from the steps described in this doc. I followed some more steps to achieve what I was looking for.
In the app level build.gradle file,
under the dependencies section,
i added the following
implementation 'androidx.multidex:multidex:2.0.0'
then the 2 lines which includes androidTestImplementation under dependencies section is changed to the following.
androidTestImplementation 'com.androidx.support.test:runner:1.1.0'
androidTestImplementation 'com.androidx.support.test.espresso:espresso-core:3.1.0'
Note the androix here.
Once that is finished under the defaultConfig section please include the following;
multiDexEnabled true
And also change the minSdkVersion from 16 to 21.
Next, go to the gradle.properties file and add the below lines of code
android.useAndroidX=true
android.enableJetifier=true
Once all these steps are done, I think you will be good to go.
P.S - I am not sure whether this is fixed at a later point of time, but at the timing of this blog, this steps along with the steps mentioned in the above doc is enough for firebase to work smoothly in flutter.
Comments
Post a Comment