Closed Donzo24 closed 3 months ago
@Donzo24 I don't know if this will work but try it!
import 'package:device_info_plus/device_info_plus.dart';
import 'dart:io';
import 'package:flutter/foundation.dart';
//Programado por HeroRickyGames
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
Map<String, dynamic> _deviceData = <String, dynamic>{};
Map<String, dynamic> _readWindowsDeviceInfo(WindowsDeviceInfo data) {
return <String, dynamic>{
'userName': data.userName,
};
}
Future<String> getUsername() async {
return _readWindowsDeviceInfo(await deviceInfoPlugin.windowsInfo)["userName"];
}
void main () async {
try{
String UserName = await getUsername();
//Here you can go to: C:\Users\your admin our username\AppData\Local\firestore\[DEFAULT] To see which folder is created and which folders are there to replace it just below!
final dir = Directory('C:\\Users\\$UserName\\AppData\\Local\\firestore\\[DEFAULT]\\name-of-your-project-in-firebase');
if(await dir.exists()){
dir.deleteSync(recursive: true);
}
}catch(e){
// showToast("Error $e",context:context);
}
}
All this in main.dart
I hope it's useful!
Hello @Donzo24, thanks for the report. Since it's related directly to the CPP SDK, I encourage you to open an issue over there: https://github.com/firebase/firebase-cpp-sdk
Unfortunately, nothing to be done directly in the FlutterFire repository
Is there an existing issue for this?
Which plugins are affected?
Database
Which platforms are affected?
Windows
Description
Our Flutter application crashes on Windows machines with 4 GB or less of RAM when Firestore's offline persistence is enabled. This issue does not occur on machines with more than 4 GB of RAM. As a temporary workaround, we've disabled persistence, but we need a more permanent solution.
Reproducing the issue
Firebase Core version
3.3.0
Flutter Version
3.22.1
Relevant Log Output
No response
Flutter dependencies
Expand
Flutter dependencies
snippetDart SDK 3.4.1 Flutter SDK 3.22.1 sonoya_pos 1.0.0+1 dependencies: - animate_do 3.3.4 [flutter] - barcode 2.2.8 [meta qr] - barcode_widget 2.0.4 [barcode flutter] - cached_network_image 3.4.0 [cached_network_image_platform_interface cached_network_image_web flutter flutter_cache_manager octo_image] - cloud_firestore 5.2.0 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - cloud_functions 5.0.4 [cloud_functions_platform_interface cloud_functions_web firebase_core firebase_core_platform_interface flutter] - connectivity_plus 6.0.4 [flutter flutter_web_plugins connectivity_plus_platform_interface web meta nm collection] - contained_tab_bar_view 0.8.0 [flutter container_tab_indicator] - cupertino_icons 1.0.8 - currency_text_input_formatter 2.2.3 [flutter intl] - data_table_2 2.5.15 [flutter async] - dio 5.5.0+1 [async http_parser meta path dio_web_adapter] - dotted_line 3.2.2 [flutter] - enefty_icons 1.0.7 [flutter] - excel 4.0.3 [archive xml collection equatable] - firebase_analytics 11.2.1 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_auth 5.1.3 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 3.3.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_core_platform_interface 5.2.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_crashlytics 4.0.4 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_database 11.0.4 [firebase_core firebase_core_platform_interface firebase_database_platform_interface firebase_database_web flutter] - firebase_storage 12.1.2 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter] - fl_chart 0.68.0 [equatable flutter] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine] - flutter_animated_icons 1.0.1 [flutter cupertino_icons lottie] - flutter_barcode 0.0.2+1 [flutter] - flutter_barcode_listener 0.1.4 [flutter] - flutter_dialogs 3.0.0 [flutter] - flutter_easyloading 3.0.5 [flutter flutter_spinkit] - flutter_epos_bluetooth 0.0.1 [flutter rxdart bluetooth_epos] - flutter_form_builder 9.3.0 [flutter intl] - flutter_launcher_icons 0.13.1 [args checked_yaml cli_util image json_annotation path yaml] - flutter_multi_formatter 2.13.0 [flutter collection base58check bech32] - flutter_native_splash 2.4.1 [args flutter flutter_web_plugins html image meta path universal_io xml yaml ansicolor] - flutter_typeahead 4.8.0 [flutter flutter_keyboard_visibility pointer_interceptor] - font_awesome_flutter 10.7.0 [flutter] - form_builder_extra_fields 10.2.0 [flutter flutter_form_builder flutter_colorpicker dropdown_search signature intl flutter_typeahead flutter_rating_bar] - form_builder_file_picker 4.1.0 [community_material_icon file_picker flutter flutter_form_builder] - form_builder_phone_field 2.0.1 [flutter flutter_form_builder phone_number country_pickers] - form_builder_validators 11.0.0 [flutter flutter_localizations intl] - get 4.6.6 [flutter] - get_storage 2.1.1 [flutter get path_provider] - getwidget 4.0.0 [flutter] - google_fonts 6.2.1 [flutter http path_provider crypto] - http 1.2.2 [async http_parser meta web] - image 4.2.0 [archive meta xml] - image_picker 1.1.2 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_linux image_picker_macos image_picker_platform_interface image_picker_windows] - infinite_scroll_pagination 4.0.0 [flutter flutter_staggered_grid_view sliver_tools] - intl 0.17.0 [clock path] - intl_phone_field 3.2.0 [flutter] - open_file 3.3.2 [flutter ffi] - paginate_firestore 1.0.3+1 [flutter bloc flutter_bloc provider] - path_provider 2.1.4 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - pdf 3.11.0 [archive barcode bidi crypto image meta path_parsing vector_math xml] - printing 5.13.1 [ffi flutter flutter_web_plugins http image meta pdf pdf_widget_wrapper plugin_platform_interface web] - responsive_builder 0.7.1 [flutter provider] - shared_preferences 2.3.1 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - simple_numpad 1.0.5 [flutter] - step_progress_indicator 1.0.2 [flutter] - switcher_button 0.0.4 [flutter] - syncfusion_flutter_datagrid 26.2.7 [flutter syncfusion_flutter_core collection] - syncfusion_flutter_pdfviewer 26.2.7 [flutter vector_math async http uuid device_info_plus intl syncfusion_pdfviewer_platform_interface syncfusion_pdfviewer_web syncfusion_pdfviewer_macos syncfusion_pdfviewer_windows syncfusion_flutter_core syncfusion_flutter_pdf syncfusion_flutter_signaturepad url_launcher] - system_info2 4.0.0 [globbing path] - uuid 4.4.2 [crypto sprintf meta fixnum] dev dependencies: - change_app_package_name 1.3.0 - flutter_lints 4.0.0 [lints] - flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing async boolean_selector characters collection leak_tracker leak_tracker_testing material_color_utilities meta source_span stream_channel string_scanner term_glyph vm_service] - innosetup 0.1.3 [meta version] - json_serializable 6.8.0 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper] - msix 3.16.7 [args yaml path package_config get_it image pub_semver console cli_util] dependency overrides: - country_pickers 3.0.1 [flutter] - intl 0.17.0 [clock path] transitive dependencies: - _fe_analyzer_shared 67.0.0 [meta] - _flutterfire_internals 1.3.40 [collection firebase_core firebase_core_platform_interface flutter meta] - analyzer 6.4.1 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - ansicolor 2.0.2 - archive 3.4.9 [crypto path pointycastle] - args 2.5.0 - async 2.11.0 [collection meta] - base58check 2.0.0 [crypto collection] - bech32 0.2.2 [convert] - bidi 2.0.10 - bloc 8.1.4 [meta] - bluetooth_epos 0.0.1 [flutter json_annotation rxdart] - boolean_selector 2.1.1 [source_span string_scanner] - build 2.4.1 [analyzer async convert crypto glob logging meta package_config path] - build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml] - cached_network_image_platform_interface 4.1.0 [flutter flutter_cache_manager] - cached_network_image_web 1.3.0 [cached_network_image_platform_interface flutter flutter_cache_manager] - characters 1.3.0 - checked_yaml 2.0.3 [json_annotation source_span yaml] - cli_util 0.4.1 [meta path] - clock 1.1.1 - cloud_firestore_platform_interface 6.3.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 4.1.0 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins] - cloud_functions_platform_interface 5.5.33 [firebase_core flutter meta plugin_platform_interface] - cloud_functions_web 4.9.11 [cloud_functions_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins] - collection 1.18.0 - community_material_icon 5.9.55 [flutter] - connectivity_plus_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - console 4.1.0 [vector_math] - container_tab_indicator 0.3.0 [flutter] - convert 3.1.1 [typed_data] - cross_file 0.3.4+2 [meta web] - crypto 3.0.3 [typed_data] - csslib 1.0.0 [source_span] - dart_style 2.3.6 [analyzer args collection path pub_semver source_span] - dbus 0.7.10 [args ffi meta xml] - device_info_plus 10.1.1 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta web win32 win32_registry] - device_info_plus_platform_interface 7.0.1 [flutter meta plugin_platform_interface] - dio_web_adapter 1.0.1 [dio http_parser meta] - dropdown_search 5.0.6 [flutter] - equatable 2.0.5 [collection meta] - fake_async 1.3.1 [clock collection] - ffi 2.1.2 - file 7.0.0 [meta path] - file_picker 5.5.0 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32] - file_selector_linux 0.9.2+1 [cross_file file_selector_platform_interface flutter] - file_selector_macos 0.9.4 [cross_file file_selector_platform_interface flutter] - file_selector_platform_interface 2.6.2 [cross_file flutter http plugin_platform_interface] - file_selector_windows 0.9.3+2 [cross_file file_selector_platform_interface flutter] - firebase_analytics_platform_interface 4.2.1 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.9+1 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins] - firebase_auth_platform_interface 7.4.3 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.12.5 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser meta web] - firebase_core_web 2.17.4 [firebase_core_platform_interface flutter flutter_web_plugins meta web] - firebase_crashlytics_platform_interface 3.6.40 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_database_platform_interface 0.2.5+40 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_database_web 0.2.5+12 [collection firebase_core firebase_core_web firebase_database_platform_interface flutter flutter_web_plugins] - firebase_storage_platform_interface 5.1.27 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_web 3.9.12 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http meta web] - fixnum 1.1.0 - flutter_bloc 8.1.6 [bloc flutter provider] - flutter_cache_manager 3.4.0 [clock collection file flutter http path path_provider rxdart sqflite uuid] - flutter_colorpicker 1.1.0 [flutter] - flutter_keyboard_visibility 5.4.1 [meta flutter_keyboard_visibility_platform_interface flutter_keyboard_visibility_linux flutter_keyboard_visibility_macos flutter_keyboard_visibility_web flutter_keyboard_visibility_windows flutter] - flutter_keyboard_visibility_linux 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_keyboard_visibility_macos 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_keyboard_visibility_platform_interface 2.0.0 [flutter meta plugin_platform_interface] - flutter_keyboard_visibility_web 2.0.0 [flutter_keyboard_visibility_platform_interface flutter_web_plugins flutter] - flutter_keyboard_visibility_windows 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math] - flutter_plugin_android_lifecycle 2.0.21 [flutter] - flutter_rating_bar 4.0.1 [flutter] - flutter_spinkit 5.2.1 [flutter] - flutter_staggered_grid_view 0.7.0 [flutter] - flutter_svg 2.0.10+1 [flutter http vector_graphics vector_graphics_codec vector_graphics_compiler] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math] - get_it 7.7.0 [async collection meta] - glob 2.1.2 [async collection file path string_scanner] - globbing 1.0.0 [path] - html 0.15.4 [csslib source_span] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image_picker_android 0.8.12+10 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_for_web 3.0.5 [flutter flutter_web_plugins image_picker_platform_interface mime web] - image_picker_ios 0.8.12 [flutter image_picker_platform_interface] - image_picker_linux 0.2.1+1 [file_selector_linux file_selector_platform_interface flutter image_picker_platform_interface] - image_picker_macos 0.2.1+1 [file_selector_macos file_selector_platform_interface flutter image_picker_platform_interface] - image_picker_platform_interface 2.10.0 [cross_file flutter http plugin_platform_interface] - image_picker_windows 0.2.1+1 [file_selector_platform_interface file_selector_windows flutter image_picker_platform_interface] - js 0.7.1 - json_annotation 4.9.0 [meta] - leak_tracker 10.0.4 [clock collection meta path vm_service] - leak_tracker_flutter_testing 3.0.3 [flutter leak_tracker leak_tracker_testing matcher meta] - leak_tracker_testing 3.0.1 [leak_tracker matcher meta] - lints 4.0.0 - logging 1.2.0 - lottie 1.4.3 [archive flutter path vector_math] - matcher 0.12.16+1 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.8.0 [collection] - meta 1.12.0 - mime 1.0.5 - nested 1.0.0 [flutter] - nm 0.5.0 [dbus] - octo_image 2.1.0 [flutter] - package_config 2.1.0 [path] - path 1.9.0 - path_parsing 1.0.1 [vector_math meta] - path_provider_android 2.2.9 [flutter path_provider_platform_interface] - path_provider_foundation 2.4.0 [flutter path_provider_platform_interface] - path_provider_linux 2.2.1 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.1.2 [flutter platform plugin_platform_interface] - path_provider_windows 2.3.0 [ffi flutter path path_provider_platform_interface] - pdf_widget_wrapper 1.0.4 [flutter pdf] - petitparser 6.0.2 [meta] - phone_number 2.1.0 [flutter meta] - platform 3.1.5 - plugin_platform_interface 2.1.8 [meta] - pointer_interceptor 0.9.3+7 [flutter] - pointycastle 3.9.1 [collection convert js] - provider 6.1.2 [collection flutter nested] - pub_semver 2.1.4 [collection meta] - pubspec_parse 1.3.0 [checked_yaml collection json_annotation pub_semver yaml] - qr 3.0.2 [meta] - rxdart 0.27.7 - shared_preferences_android 2.3.0 [flutter shared_preferences_platform_interface] - shared_preferences_foundation 2.5.0 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.4.0 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_platform_interface 2.4.1 [flutter plugin_platform_interface] - shared_preferences_web 2.4.1 [flutter flutter_web_plugins shared_preferences_platform_interface web] - shared_preferences_windows 2.4.0 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - signature 5.5.0 [flutter flutter_svg image] - sky_engine 0.0.99 - sliver_tools 0.2.12 [flutter] - source_gen 1.5.0 [analyzer async build dart_style glob path source_span yaml] - source_helper 1.3.4 [analyzer collection source_gen] - source_span 1.10.0 [collection path term_glyph] - sprintf 7.0.0 - sqflite 2.3.3+1 [flutter sqflite_common path] - sqflite_common 2.5.4 [synchronized path meta] - stack_trace 1.11.1 [path] - stream_channel 2.1.2 [async] - string_scanner 1.2.0 [source_span] - syncfusion_flutter_core 26.2.7 [vector_math flutter] - syncfusion_flutter_pdf 26.2.7 [flutter intl xml syncfusion_flutter_core crypto convert http] - syncfusion_flutter_signaturepad 26.2.7 [flutter syncfusion_flutter_core] - syncfusion_pdfviewer_macos 26.2.7 [flutter syncfusion_pdfviewer_platform_interface] - syncfusion_pdfviewer_platform_interface 26.2.7 [flutter plugin_platform_interface] - syncfusion_pdfviewer_web 26.2.7 [flutter flutter_web_plugins js meta syncfusion_pdfviewer_platform_interface] - syncfusion_pdfviewer_windows 26.2.7 [flutter] - synchronized 3.1.0+1 - term_glyph 1.2.1 - test_api 0.7.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph] - typed_data 1.3.2 [collection] - universal_io 2.2.2 [collection meta typed_data] - url_launcher 6.3.0 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - url_launcher_android 6.3.8 [flutter url_launcher_platform_interface] - url_launcher_ios 6.3.1 [flutter url_launcher_platform_interface] - url_launcher_linux 3.1.1 [flutter url_launcher_platform_interface] - url_launcher_macos 3.2.0 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.3.2 [flutter plugin_platform_interface] - url_launcher_web 2.3.2 [flutter flutter_web_plugins url_launcher_platform_interface web] - url_launcher_windows 3.1.2 [flutter url_launcher_platform_interface] - vector_graphics 1.1.11+1 [flutter http vector_graphics_codec] - vector_graphics_codec 1.1.11+1 - vector_graphics_compiler 1.1.11+1 [args meta path_parsing xml vector_graphics_codec path] - vector_math 2.1.4 - version 3.0.2 - vm_service 14.2.1 - watcher 1.1.0 [async path] - web 0.5.1 - win32 5.5.3 [ffi] - win32_registry 1.1.4 [ffi win32] - xdg_directories 1.0.4 [meta path] - xml 6.5.0 [collection meta petitparser] - yaml 3.1.2 [collection source_span string_scanner]
Additional context and comments
Expected Behavior: The application should work seamlessly with Firestore persistence enabled, caching data locally without crashes, regardless of the machine's RAM capacity.
Actual Behavior: The application crashes on Windows machines with 4 GB or less of RAM when Firestore persistence is enabled.
Temporary Workaround: Disabling Firestore persistence resolves the issue temporarily but sacrifices offline capabilities.