Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter multidex problem With FirebaseAuth , Firestore and Google Sign in

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.

like image 209
Asfaque Ahmed Avatar asked Sep 08 '18 05:09

Asfaque Ahmed


3 Answers

In your app/build.gradle file inside your android folder , add this attribute multiDexEnabled.

         defaultConfig {
                ...
                multiDexEnabled true
            }

Don't forget:

flutter clean
like image 51
diegoveloper Avatar answered Nov 20 '22 08:11

diegoveloper


I did for this same error to make it work

multiDexEnabled true

dependencies {
implementation "androidx.multidex:multidex:2.0.1"
}

documentation

like image 23
Azhar Ali Avatar answered Nov 20 '22 09:11

Azhar Ali


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
        }
        
    }
like image 2
Ahmed Osama Avatar answered Nov 20 '22 08:11

Ahmed Osama