-
-
Notifications
You must be signed in to change notification settings - Fork 276
Description
Platform
Dart
Obfuscation
Enabled
Debug Info
Enabled
Doctor
[✓] Flutter (Channel stable, 3.10.2, on macOS 13.3.1 22E772610a darwin-x64, locale en-IN)
• Flutter version 3.10.2 on channel stable at /Users/hirensamtani/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 9cd3d0d9ff (6 days ago), 2023-05-23 20:57:28 -0700
• Engine revision 90fa3ae28f
• Dart version 3.0.2
• DevTools version 2.23.1
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at /Users/hirensamtani/Library/Android/sdk
• Platform android-33, build-tools 33.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E222b
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.2)
• Android Studio at /Applications/Android Studio.app/Contents
• 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.6+0-17.0.6b802.4-9586694)
[✓] VS Code (version 1.72.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (3 available)
• SM S908E (mobile) • R5CT50B6G5T • android-arm64 • Android 13 (API 33)
• macOS (desktop) • macos • darwin-x64 • macOS 13.3.1 22E772610a darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 113.0.5672.126
[✓] Network resources
• All expected network resources are available.
• No issues found!
Version
7.6.2
Steps to Reproduce
Simply use WidgetsFlutterBinding.ensureInitialized()
Something like
Future main() async {
// BindingBase.debugZoneErrorsAreFatal = true;
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: [SystemUiOverlay.bottom, SystemUiOverlay.top]).then((_) {
SharedPreferences.getInstance().then((prefs) {
runZonedGuarded<Future<void>>(() async {
await SentryFlutter.init(
(options) {
options.dsn = '//URL HERE';
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
options.tracesSampleRate = 1.0;
},
appRunner: () {
runApp(MyApp());
},
);
}, (error, stack) {
});
});
});
}
Expected Result
There should be no warnings. Especially not of Zone mismatch.
Actual Result
The following assertion was thrown during runApp:
Zone mismatch.
The Flutter bindings were initialized in a different zone than is now being used. This will likely cause confusion and bugs as any zone-specific configuration will inconsistently use the configuration of the original binding initialization zone or this zone based on hard-to-predict factors such as which zone was active when a particular callback was set.
It is important to use the same zone when calling ensureInitialized on the binding as when calling runApp later.
To make this warning fatal, set BindingBase.debugZoneErrorsAreFatal to true before the bindings are initialized (i.e. as the first statement in void main() { }).
When the exception was thrown, this was the stack:
#0 BindingBase.debugCheckZone. (package:flutter/src/foundation/binding.dart:497:29)
#1 BindingBase.debugCheckZone (package:flutter/src/foundation/binding.dart:502:6)
#2 runApp (package:flutter/src/widgets/binding.dart:1080:18)
#3 main....
Are you willing to submit a PR?
None