Cloud_firestore and Firebase_auth not working together .

750 views
Skip to first unread message

Animesh singh

unread,
Aug 23, 2018, 1:04:45 PM8/23/18
to Flutter Dev

I am developing a Flutter app. My app works fine with cloud_firestore and firebase_auth packages when I use them separately. However, when I include both of them together in my pubspecs.yaml file, the build fails and the following message is shown:

Note: /home/saber/Code/mobile_dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.4/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: /home/saber/Code/mobile_dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.18/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /home/saber/Code/mobile_dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.18/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: /home/saber/Code/mobile_dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.5/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

    java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

Here are the depenencies that I have in my pubspec.yaml file:

dependencies:
   flutter:
     sdk: flutter
   firebase_auth: ^0.5.18
   cloud_firestore: ^0.7.4

I checked the version of packages and they both seem to be at the latest version.

Any help on resolving this issue would be appreciated!

This might be connected to this issue, but I am not sure.

Feras Dawod

unread,
Aug 24, 2018, 1:20:58 AM8/24/18
to Flutter Dev
Try adding

multiDexEnabled true

to the app's build.gradle file.

I had the exact same issue and this solved it.

Jonas Sander

unread,
Aug 24, 2018, 4:20:31 PM8/24/18
to Flutter Dev
Reply all
Reply to author
Forward
0 new messages