[Bug]: [share_plus] Windows: hard crash on share() when the app has no implicit view (multi-window)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- desktop, operating-systems
Research direction
Start with windows/share_plus_plugin.cpp and the Windows setup described in the issue, then reproduce using Flutter's examples/multiple_windows sample. Verify that calling share() without an implicit view no longer terminates the process and instead produces the expected catchable failure when the share sheet cannot be anchored.
Written by the indexing model from the issue text.
Description
Platform
Windows 11 Pro 25H2 (10.0.26200.9168), x64
Plugin
share_plus
Version
13.3.0 (share_plus_platform_interface 7.2.0)
Flutter SDK
3.48.0-1.0.pre-362, channel main, Dart 3.14.0
Steps to reproduce
Calling share() on Windows kills the process instantly - no exception, no Dart error, nothing in the console. The app window just disappears.
It's a null dereference in the Windows plugin:
// windows/share_plus_plugin.cpp:40
HWND SharePlusWindowsPlugin::GetWindow() {
return ::GetAncestor(registrar_->GetView()->GetNativeWindow(), GA_ROOT);
}
GetView() returns the implicit view, and the embedder only creates one if the engine actually has it:
// cpp_client_wrapper/include/flutter/plugin_registrar_windows.h
FlutterDesktopViewRef implicit_view = FlutterDesktopPluginRegistrarGetView(core_registrar);
if (implicit_view) { implicit_view_ = std::make_unique<FlutterView>(implicit_view); }
...
// DEPRECATED: Use |GetViewById| instead.
FlutterView* GetView() { return implicit_view_.get(); }
An app using the new experimental windowing (enable-windowing: true, runWidget + WindowManager) has no implicit view - the runner creates a bare FlutterEngine and windows are created from Dart. So GetView() returns null, and GetWindow() dereferences it.
Worth noting the embedder already marks GetView() deprecated in favour of GetViewById, precisely because there's no single implicit view once multi-window is in play.
To reproduce:
- Start from Flutter's own multi-window sample (
examples/multiple_windowsin the SDK), or any app withenable-windowing: truewhosewindows/runner/main.cppruns a bareFlutterEnginewith noFlutterViewController. - Add
share_plus: ^13.3.0. - Call
SharePlus.instance.share(ShareParams(text: 'hello'))from a button. - Press it. The process dies on the spot.
Expected: either the share sheet opens, or the call fails with a PlatformException that Dart can catch.
Actual: access violation in the plugin, process gone, nothing logged.
I realise experimental windowing is a moving target and I'm not expecting the share sheet to work here. But a null check would turn a silent process kill into an error you can actually see, which is most of the pain. GetViewById looks like the real fix if the plugin can be told which window to anchor to.
Code Sample
// main.dart - the multi-window shape, trimmed to the parts that matter
void main() {
WidgetsFlutterBinding.ensureInitialized();
runWidget(const MultiWindowApp());
}
// ... WindowManager(initialWindows: [WindowEntry(controller: ..., builder: ...)])
void _onSharePressed() {
SharePlus.instance.share(ShareParams(text: '1787392119')); // never returns
}
// windows/runner/main.cpp - no FlutterViewController, so no implicit view
auto const engine{std::make_shared<flutter::FlutterEngine>(project)};
RegisterPlugins(engine.get());
engine->Run();
Logs
[ +1 ms] The Flutter DevTools debugger and profiler on Windows is available at:
http://127.0.0.1:63384/wAZQr2_dWlo=/devtools/?uri=ws://127.0.0.1:63384/wAZQr2_dWlo=/ws
[+6899 ms] Service protocol connection closed.
[ +1 ms] Lost connection to device.
[ +1 ms] DevFS: Deleting filesystem on the device (file:///C:/Users/user/AppData/Local/Temp/myappf85f3646/myapp/)
[ +1 ms] DevFS: Deleted filesystem on the device (file:///C:/Users/user/AppData/Local/Temp/myappf85f3646/myapp/)
[ +3 ms] "flutter run" took 15,177ms.
[ +41 ms] Running 4 shutdown hooks
[ +20 ms] Shutdown hooks complete
[ +142 ms] exiting with code 0
Flutter Doctor
[!] Flutter (Channel main, 3.48.0-1.0.pre-362, on Microsoft Windows [Version 10.0.26200.9168], locale en-US)
• Flutter version 3.48.0-1.0.pre-362 on channel main at C:\Programs\Develop\Flutter\main
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 68d6be5f9b (6 hours ago), 2026-08-22 04:47:17 +0000
• Engine revision 68d6be5f9b
• Dart version 3.14.0 (build 3.14.0-147.0.dev)
• DevTools version 2.61.0-dev.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-record-use, enable-swift-package-manager, omit-legacy-version-file, enable-windowing, enable-lldb-debugging, enable-uiscene-migration, enable-riscv64
[✓] Windows Version (Windows 11 or higher, 25H2, 2009)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
[✓] Chrome - develop for the web
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2026 18.9.1)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\18\Community
• Windows 10 SDK version 10.0.26100.0
[✓] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.26200.9168]
[✓] Network resources
Checklist before submitting a bug
- I searched issues in this repository and couldn't find such bug/problem
- I Google'd a solution and I couldn't find it
- I searched on StackOverflow for a solution and I couldn't find it
- I read the README.md file of the plugin
- I'm using the latest version of the plugin
- All dependencies are up to date with
flutter pub upgrade - I did a
flutter clean - I tried running the example project
- Dominant language
- Dart
- Stars
- 1.9k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fluttercommunity/plus_plugins
-
bug triage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
fluttercommunity/plus_plugins#3964 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
fluttercommunity/plus_plugins#3943 ·
-
enhancement triage
Difficulty 4/5 3-5 days Newbie friendliness 55/100
fluttercommunity/plus_plugins#3976 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
fluttercommunity/plus_plugins#3974 ·
-
enhancement triage
Difficulty 5/5 Over a week Newbie friendliness 48/100
fluttercommunity/plus_plugins#3973 ·
All issues in fluttercommunity/plus_plugins
Similar issues
-
ui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
error Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Bug Flutter User Feedbacks
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
getsentry/sentry-dart#4042 · 1 comment ·
-
team-infra
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100