Baseflow / Baseflow/flutter-geolocator

[Bug]: Channel sent message from native to Flutter on a non-platform thread.

Open
#1,451 1 comment 5 reactions 1 assignee Claimed by @mvanbeusekom View on GitHub
platform: windows status: blocked type: bug
Dominant language
Dart
Stars
1.3k
Forks
803
Avg merge
8h 16m
Merged PRs (30d)
1

Description

### Please check the following before submitting a new issue.

- [X] I have searched the [existing issues](https://github.com/baseflow/flutter-geolocator/issues).
- [X] I have carefully [read the documentation](https://github.com/Baseflow/flutter-geolocator/blob/main/geolocator/README.md) and verified I have added the required platform specific configuration.

### Please select affected platform(s)

- [ ] Android
- [ ] iOS
- [ ] Linux
- [ ] macOS
- [ ] Web
- [X] Windows

### Steps to reproduce

Both the example in geolocator/ and the example in geolocator_windows/ produce the errors described below.

### Expected results

No error message in the debug console,

### Actual results

I'm getting the following error messages in the debug console:

```
[ERROR:flutter/shell/common/shell.cc(1038)] The 'flutter.baseflow.com/geolocator_service_updates'
channel sent a message from native to Flutter on a non-platform thread. Platform channel messages
must be sent on the platform thread. Failure to do so may result in data loss or crashes, and must
be fixed in the plugin or application code creating that channel.

See https://docs.flutter.dev/platform-integration/platform-channels#channels-and-platform-threading
for more information.
```

```
[ERROR:flutter/shell/common/shell.cc(1038)] The 'flutter.baseflow.com/geolocator_updates'
channel sent a message from native to Flutter on a non-platform thread. Platform channel messages
must be sent on the platform thread. Failure to do so may result in data loss or crashes, and must
be fixed in the plugin or application code creating that channel.

See https://docs.flutter.dev/platform-integration/platform-channels#channels-and-platform-threading
for more information.
```

### Code sample

Code sample

```dart
Geolocator.getPositionStream().listen((position) {
log('Position: ${position.latitude}, ${position.longitude}');
});
```

### Screenshots or video

Screenshots or video demonstration

[Upload media here]

### Version

11.0.0

### Flutter Doctor output

Doctor output

```console
[√] Flutter (Channel stable, 3.19.1, on Microsoft Windows [Version 10.0.22631.3155], locale en-NL)
• Flutter version 3.19.1 on channel stable at C:\Users\rvanm\Source\Repos\flutter\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision abb292a07e (2 weeks ago), 2024-02-20 14:35:05 -0800
• Engine revision 04817c99c9
• Dart version 3.3.0
• 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:\Users\rvanm\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Enterprise 2022 17.9.1)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Enterprise
• Visual Studio Enterprise 2022 version 17.9.34616.47
• Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2023.1)
• Android Studio at C:\Program Files\Android\Android 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.7+0-b2043.56-10550314)

[√] VS Code, 64-bit edition (version 1.87.0)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.84.0

[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.3155]
• Chrome (web) • chrome • web-javascript • Google Chrome 122.0.6261.95
• Edge (web) • edge • web-javascript • Microsoft Edge 122.0.2365.66

[√] Network resources
• All expected network resources are available.

• No issues found!
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.