Flutter application is working fine if i use only firestore. But as now i want to add Firebase Auth it is Causing problem And showing Dex error log
How can i use both firestore and Firebase Auth.
In your app/build.gradle
file inside your android
folder , add this attribute multiDexEnabled
.
defaultConfig {
...
multiDexEnabled true
}
Don't forget:
flutter clean
I did for this same error to make it work
multiDexEnabled true
dependencies {
implementation "androidx.multidex:multidex:2.0.1"
}
documentation
Although having a multiDexEnabled
true can solve the problem it will result in a minSdkVersion 21
for your application because it will crash on all older devices than lollipop witch means losing millions of potential customers who still own this phones , right 🤔😥??
there is a better solution
just open your App level build.gradle and add these lines in place :
buildTypes {
release {
minifyEnabled true
}
debug{
minifyEnabled true
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With