bitsdojo / bitsdojo_window

A Flutter package that makes it easy to customize and work with your Flutter desktop app window.
http://www.youtube.com/watch?v=bee2AHQpGK4
MIT License
815 stars 229 forks source link

can't run App in Windows 11 22H2 after add bitsdojo c++ library to main.cpp #190

Closed Ali-Fadaei closed 2 years ago

Ali-Fadaei commented 2 years ago

I installed windows 11 22H2 preRelease (Build 22621.382) I realized my flutter apps doesn't run after add bitsdojo_window_plugin.h to main.cpp

here my flutter doctor -v:

[✓] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.22621.382], locale en-US) • Flutter version 3.0.5 at C:\Flutter\Flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision f1875d570e (4 weeks ago), 2022-07-13 11:24:16 -0700 • Engine revision e85ea0e79c • Dart version 2.17.6 • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) • Android SDK at C:\Users\Alifa\AppData\Local\Android\sdk • Platform android-33, build-tools 33.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840) • All Android licenses accepted.

[✗] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.0) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.3.32804.467 • Windows 10 SDK version 10.0.22621.0

[✓] Android Studio (version 2021.2) • 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 11.0.12+7-b1504.28-7817840)

[✓] VS Code (version 1.70.1) • VS Code at C:\Users\Alifa\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.46.0

[✓] Connected device (2 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22621.382] • Edge (web) • edge • web-javascript • Microsoft Edge 104.0.1293.54

[✓] HTTP Host Availability • All required HTTP hosts are available

after run flutter run -d windows -v it completes building successfully but can't run app, after 1-2 minutes here's the error:

[ +32 ms] Building Windows application... (completed in 108.8s) [+11229 ms] Error waiting for a debug connection: The log reader stopped unexpectedly, or never started. [ +1 ms] Error launching application on Windows. [ +3 ms] "flutter run" took 121,933ms. [ +6 ms] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3) #1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:699:9) <asynchronous suspension> #2 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1183:27) <asynchronous suspension> #3 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19) <asynchronous suspension> #4 CommandRunner.runCommand (package:args/command_runner.dart:209:13) <asynchronous suspension> #5 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9) <asynchronous suspension> #6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19) <asynchronous suspension> #7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5) <asynchronous suspension> #8 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9) <asynchronous suspension> #9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19) <asynchronous suspension> #10 main (package:flutter_tools/executable.dart:94:3) <asynchronous suspension> [ +254 ms] ensureAnalyticsSent: 252ms [ +4 ms] Running shutdown hooks [ +2 ms] Shutdown hooks complete [ +2 ms] exiting with code 1

seems can't run any flutter app (debug/release) developed with bitsdojo in windows 11 22H2. Please Help! 🙏🏻

bitsdojo commented 2 years ago

Do you have a test repository that I can clone and test on my machine?

mdsitton commented 2 years ago

I can reproduce this as well

mdsitton commented 2 years ago

After some testing it appears to be an issue within the handle_nccalcsize function in bitsdojo_window.cpp commenting out the code here allows it to run.

mdsitton commented 2 years ago

seems that the issue is already fixed: https://github.com/bitsdojo/bitsdojo_window/blob/master/bitsdojo_window_windows/windows/bitsdojo_window.cpp#L284

This if which wasn't in the version we were using fixes it

bitsdojo commented 2 years ago

I will close this now. Feel free to reopen if you encounter any issues.