1

You probably saw this question before, but I am still not able to find an answer. Everything works fine in debug mode, but when trying to build the app in release mode, the shared preferences don't work. Here is what I've tried

flutter build apk --no-shrink flutter build appbundle --no-shrink

I know there are already questions out there, but the answers don't work for me: SharedPreferences not instantiating in release build

Jay
  • 231
  • 1
  • 12

2 Answers2

0

Make sure that you have fully set up Facebook login, Google login, Apple login if you have one of them. If you don't have them check any pub that you haven't fully set up, and remove un used pubs.

Mohamad Alzabibi
  • 166
  • 1
  • 14
0

I had the same problem. In my case, I called the getter/setter too quickly when the instance of SharedPreferences was still null and has not been initialized yet. See the answer of this post for reference: Flutter: Shared Preferences null on Startup

BugsBuggy
  • 115
  • 1
  • 9