0

I have a problem that I can't solve. I have developed a Flutter app who works with FirebaseAuth and Firebase Cloud Firestore.

In debug mode, on iOS simulator and Android emulator, everything works fine, but on release uploaded on Google Play, the signin and signup no longer work.

I have edited my SHA-1 fingerprint on Firebase with the SHA-1 signing app of Google Play but the problem persists.

If I run the app on release mode in my Android emulator, I have this message:

E/flutter ( 6802): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Null' is not a subtype of type 'Map<String, dynamic>' in type cast
E/flutter ( 6802): #0      _SignInScreenState._signin.<anonymous closure> (package:winiz/screens/auth/signin_screen.dart:98)
E/flutter ( 6802): <asynchronous suspension>
E/flutter ( 6802): #1      _SignInScreenState._signin (package:winiz/screens/auth/signin_screen.dart:96)
E/flutter ( 6802): <asynchronous suspension>
E/flutter ( 6802): 

I want to specify that on iOS with TestFlight, everything works.

I try to add in the android/app/build.gradle like I see here but not working anymore.

minifyEnabled true
shrinkResources true

Thanks so much for your help.

Fabien
  • 21
  • 4

2 Answers2

0

In the signin_screen.dart on line number 98, you're getting null from somewhere, but you're trying to use that variblae as if it was Map<String, dynamic>.

Give more details on what's in that line and around it, then I might be able to tell you more.

  • Yes, i get null because the cloud Firestore connection not work and the app can't retrieve datas. In debug mode, everything works fine. – Fabien Jul 02 '23 at 07:09
-1

I found my solution editing the android/app/build.gradle file.

I have modified minifyEnabled to false and shrinkResources to false:

buildTypes {
       release {
           signingConfig signingConfigs.release
           minifyEnabled false
           shrinkResources false
       }
   }
Fabien
  • 21
  • 4
  • Disabling minify and shrinking is not a solution here, maybe could be viewed as workaround. Please read about proguard, R8 etc for android. – Krzysztof Kubicki Jul 03 '23 at 13:07