Which plugins are affected?
Cloud Functions
Which platforms are affected?
Windows
Description
When I run my Flutter application on Windows 10 x64, the app crashes while listening to a document with cloud_firestore. There are no debug messages shown. However, the same listening works flawlessly on macOS.
Reproducing the issue
Create Flutter Project for only windows platform
flutter create --org com.clipnavi --description 'test' --platforms windows --template app test
add firebase project
dart pub global activate flutterfire_cli
flutterfire configure --project=clipspace1
check only windows and enter.
pub add
flutter pub add firebase_core
flutter pub add cloud_firestore
Open project folder with vs code.
main.dart:
<code>import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:test/firebase_options.dart';
import 'package:test/my_home_page.dart';
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
class MyApp extends StatelessWidget {
const MyApp({super.key});
Widget build(BuildContext context) {
return const MaterialApp(
<code>import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:test/firebase_options.dart';
import 'package:test/my_home_page.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: MyHomePage(),
);
}
}
</code>
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:test/firebase_options.dart';
import 'package:test/my_home_page.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: MyHomePage(),
);
}
}
my_home_page.dart:
<code>import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
State<MyHomePage> createState() => _MyHomePageState();
class _MyHomePageState extends State<MyHomePage> {
FirebaseFirestore.instance
.doc("eELQ6vSdSPcgM5Ha3RTyHKtBPBl1")
print("current data: ${document.data()}");
onError: (error) => print("Listen failed: $error"),
Widget build(BuildContext context) {
child: Text(isEnable ? "true" : "false"),
<code>import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
bool isEnable = false;
@override
void initState() {
super.initState();
FirebaseFirestore.instance
.collection("status")
.doc("eELQ6vSdSPcgM5Ha3RTyHKtBPBl1")
.snapshots()
.listen(
(document) {
print("No problem 1");
print("current data: ${document.data()}");
},
onError: (error) => print("Listen failed: $error"),
);
}
@override
Widget build(BuildContext context) {
return Center(
child: Text(isEnable ? "true" : "false"),
);
}
}
</code>
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
bool isEnable = false;
@override
void initState() {
super.initState();
FirebaseFirestore.instance
.collection("status")
.doc("eELQ6vSdSPcgM5Ha3RTyHKtBPBl1")
.snapshots()
.listen(
(document) {
print("No problem 1");
print("current data: ${document.data()}");
},
onError: (error) => print("Listen failed: $error"),
);
}
@override
Widget build(BuildContext context) {
return Center(
child: Text(isEnable ? "true" : "false"),
);
}
}
Check Firebase Database:
Firebase Database
flutter run
Firebase Core version
2.30.1
Flutter Version
3.19.6
Relevant Log Output
Launching libmain.dart on Windows in debug mode…
CMake Deprecation Warning at C:/Users/olerh/Desktop/windragon/test/build/windows/x64/extracted/firebase_cpp_sdk_windows/CMakeLists.txt:17 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument value or use a … suffix to tell
CMake that the project does not need compatibility with older versions.
2
√ Built buildwindowsx64runnerDebugtest.exe.
Connecting to VM Service at ws://127.0.0.1:51213/pc8BnbWb_lk=/ws
Lost connection to device.
Exited.
Flutter dependencies
Run
flutter doctor -v
<code>[√] Flutter (Channel stable, 3.19.6, on Microsoft Windows [Version 10.0.19045.4291], locale tr-TR)
• Flutter version 3.19.6 on channel stable at C:flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 54e66469a9 (8 days ago), 2024-04-17 13:08:03 -0700
• Engine revision c4cd48e186
• DevTools version 2.31.1
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:UsersolerhAppDataLocalAndroidsdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:Program FilesAndroidAndroid Studiojbrbinjava
• Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:Program FilesGoogleChromeApplicationchrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.6)
• Visual Studio at C:Program FilesMicrosoft Visual Studio2022Community
• Visual Studio Community 2022 version 17.9.34728.123
• Windows 10 SDK version 10.0.22621.0
[√] Android Studio (version 2023.2)
• Android Studio at C:Program FilesAndroidAndroid Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
[√] VS Code (version 1.88.1)
• VS Code at C:UsersolerhAppDataLocalProgramsMicrosoft VS Code
• Flutter extension version 3.86.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.4291]
• Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.78
• Edge (web) • edge • web-javascript • Microsoft Edge 124.0.2478.51
• All expected network resources are available.
<code>[√] Flutter (Channel stable, 3.19.6, on Microsoft Windows [Version 10.0.19045.4291], locale tr-TR)
• Flutter version 3.19.6 on channel stable at C:flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 54e66469a9 (8 days ago), 2024-04-17 13:08:03 -0700
• Engine revision c4cd48e186
• Dart version 3.3.4
• DevTools version 2.31.1
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:UsersolerhAppDataLocalAndroidsdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:Program FilesAndroidAndroid Studiojbrbinjava
• Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:Program FilesGoogleChromeApplicationchrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.6)
• Visual Studio at C:Program FilesMicrosoft Visual Studio2022Community
• Visual Studio Community 2022 version 17.9.34728.123
• Windows 10 SDK version 10.0.22621.0
[√] Android Studio (version 2023.2)
• Android Studio at C:Program FilesAndroidAndroid Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
[√] VS Code (version 1.88.1)
• VS Code at C:UsersolerhAppDataLocalProgramsMicrosoft VS Code
• Flutter extension version 3.86.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.4291]
• Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.78
• Edge (web) • edge • web-javascript • Microsoft Edge 124.0.2478.51
[√] Network resources
• All expected network resources are available.
• No issues found!
</code>
[√] Flutter (Channel stable, 3.19.6, on Microsoft Windows [Version 10.0.19045.4291], locale tr-TR)
• Flutter version 3.19.6 on channel stable at C:flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 54e66469a9 (8 days ago), 2024-04-17 13:08:03 -0700
• Engine revision c4cd48e186
• Dart version 3.3.4
• DevTools version 2.31.1
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:UsersolerhAppDataLocalAndroidsdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:Program FilesAndroidAndroid Studiojbrbinjava
• Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:Program FilesGoogleChromeApplicationchrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.6)
• Visual Studio at C:Program FilesMicrosoft Visual Studio2022Community
• Visual Studio Community 2022 version 17.9.34728.123
• Windows 10 SDK version 10.0.22621.0
[√] Android Studio (version 2023.2)
• Android Studio at C:Program FilesAndroidAndroid Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
[√] VS Code (version 1.88.1)
• VS Code at C:UsersolerhAppDataLocalProgramsMicrosoft VS Code
• Flutter extension version 3.86.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.4291]
• Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.78
• Edge (web) • edge • web-javascript • Microsoft Edge 124.0.2478.51
[√] Network resources
• All expected network resources are available.
• No issues found!