Comments (3)
UPDATE:
In my application, I had disabled Firestore persistence. I tested re-enabling it, and the error did not occur anymore. It worked!
From this
FirebaseFirestore.instance.settings = const Settings(persistenceEnabled: false);
To this
FirebaseFirestore.instance.settings = const Settings(persistenceEnabled: true);
from flutterfire.
I have changed FirebaseFirestore.instance.settings = const Settings(persistenceEnabled: true); but the problem still exists. If I remove firebase folders from %LOCALAPPDATA% the app runs for a single time. but the problem still exists.
from flutterfire.
Hi @encoder90
Yes, you are correct. I celebrated too soon...
For some reason, using Firestore persistence, after the first access, the LDB and/or CURRENT files get corrupted. This only happens on some machines and I couldn't identify a pattern among them.
So, what I did to solve it was to clear the persistence as soon as Firebase is initialized, even before opening any screen in the app.
It looks like this:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
FirebaseFirestore.instance.settings = Settings(
// Curiously, it is necessary to enable persistence to avoid a crash where the database of
// this cache is not found. However, it is necessary to clear this same cache to avoid the crash due to it being corrupted.
// #12987
persistenceEnabled: Platform.isWindows,
);
// Curiously, it is necessary to enable persistence to avoid a crash where the database of
// this cache is not found. However, it is necessary to clear this same cache
// to avoid the crash due to it being corrupted.
if (Platform.isWindows) {
await FirestoreMF.instance.clearPersistence();
}
I do this only on Windows, as I haven't tested it on other platforms. In any case, it worked in the tests I did.
from flutterfire.
Related Issues (20)
- [firebase_crashlytics]: flutter macOS does not terminate the app after stop debuging HOT 7
- Found some security issues HOT 3
- [firebase_auth] linkWithCredential() throws email-already-in-use exception in flutter app
- Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ) intialize issue HOT 1
- [firebase_auth] authStateChanges() stream fires when read/write into firestore HOT 4
- 🐛 [firebase_massaging] Example flutter ios build is too old
- firebase_code: Duplicate Classes HOT 6
- Firebase Phone MFA not working with some numbers HOT 1
- [📚] Old Doc doesn't have sum() and average() example for flutter. HOT 1
- [Firebase storage]: iOS only - Unable to establish connection to channel, happens in Workmanager or isolate only HOT 1
- [Firebase_auth]: <When I use signInWithEmailAndPassword without first using the createUserWithEmailAndPassword method, I get the error message [firebase_auth/channel-error] "dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailAndPassword".> HOT 11
- 🐛 [crashlytics][release] Information from recordFlutterFatalError shows up as 'Instance of 'DiagnosticsProperty<void>' HOT 1
- [firebase_app_check] App check token does not print on Android real devices HOT 9
- [firebase_auth]: [web] referencing FirebaseAuthException after running release version of app throws exception. HOT 2
- [firebase_messaging]: After turning off the device and turn back on, onBackgroundMessage is not fired on iOS. HOT 1
- [firebase_messaging]: After turning off the device and turn back on, onBackgroundMessage is not fired on iOS. HOT 4
- [firebase_core]: Cannot build app from version 3.0.0 HOT 4
- [FirebaseAuth]: Unhandled Exception: type 'List<Object?>' is not a subtype of type 'PigeonUserInfo' in type cast HOT 4
- [firebase_analytics]: `TypeError: Cannot convert undefined or null to object` when hot reload web application HOT 2
- [📚] README files in `example` directories have outdated docs and links
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutterfire.