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
816 stars 229 forks source link

Crashed on Windows 11 #210

Open 4A6F6F6E61 opened 1 year ago

4A6F6F6E61 commented 1 year ago

Windows Version: 22621.963

My App crashes when I run it on Windows 11 with the error:

Error waiting for a debug connection: The log reader stopped unexpectedly, or never started. 

Error launching application on Windows.

This does not happen on Windows 10. When I remove the added lines in /windows/runner/main.cpp the App works (but of course, without this package). When I execute the compiled .exe of my App, It works fine on Windows 10 but instantly closes on Windows 11.

4A6F6F6E61 commented 1 year ago

With "the added lines" I mean the 2 lines required for the package. This happens on every Windows 11 PC I own. I even tried reinstalling Windows but that didn't help either. You can find my repo with the problem here.

randal923 commented 1 year ago

Happening to me as well. Probably an issue with Windows 11

randal923 commented 1 year ago

Ok, after many hours debugging I figured it out. First, create a new Flutter project and see if it works in the new project. If it does, the the issue is within your project. I cleared the cache flutter clean, deleted the windows model and created a new one flutter create -platform=windows . but nothing worked. I then copied the pubspec.yaml from the new project into the one that was not working, saved it so flutter could run the new pubspec.yaml code. I then returned back to the old pubspec.yaml and it worked =]

silasol commented 1 year ago

Happening to me as well. Probably an issue with Windows 11

bitsdojo_window: ^0.1.5

bitsdojo commented 1 year ago

With "the added lines" I mean the 2 lines required for the package. This happens on every Windows 11 PC I own. I even tried reinstalling Windows but that didn't help either. You can find my repo with the problem here.

Cloned your repo and tried running the app. Seems like there is a crash related to the flutter_acrylic package. Removing these lines related to the flutter_acrylic package made the app run without any error.

await Window.setEffect(
    effect: WindowEffect.transparent,
    color: darkMode! ? const Color(0xCC222222) : const Color(0xCCDDDDDD),
  )
bitsdojo commented 1 year ago

Happening to me as well. Probably an issue with Windows 11

bitsdojo_window: ^0.1.5

Tried it on my Windows 11 machine but everything ran ok. Do you have a sample repo that I could try?

Comanx commented 1 year ago

OS information: 版本 Windows 11 家庭中文版 (Chinese Home) 版本 21H2 安装日期 ‎2022/‎8/‎6 操作系统版本 22000.1936 体验 Windows 功能体验包 1000.22001.1000.0

iAkashPattnaik commented 5 months ago

any update on this?

4A6F6F6E61 commented 5 months ago

any update on this?

I think a windows update and/or package update fixed the issue for me. It doesn't crash anymore.

iAkashPattnaik commented 5 months ago

Idk why but I am facing this issue right now, I am on windows 11 canary version

4A6F6F6E61 commented 5 months ago

Idk why but I am facing this issue right now, I am on windows 11 canary version

Ok, I fixed this a year ago so I'm not sure what exactly fixed it, but after reading through this thread I think I remembered that I created a new project and copied the pubspec.yaml file from this new project into the old project and deleted all the window specific stuff and reinstalled windows support like one of the comments here suggested, although I do not know if this really was the issue. Did you try this?

iAkashPattnaik commented 5 months ago

Yes, I tried that. But now when I removed this complete package implementation, the app is still not opening

4A6F6F6E61 commented 5 months ago

Did you try to create a new empty project just with this package set up and run it? Does it also crash?

iAkashPattnaik commented 5 months ago

Just made a new project, release build worked. Then I copied my main project's dependencies and built, didn't open.

pubspec.yaml

name: test
description: "A new Flutter project."
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1

environment:
  sdk: '>=3.4.1 <4.0.0'

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.6
  logger: ^2.3.0
  get: ^4.6.6
  shared_preferences: ^2.2.3
  google_fonts: ^6.2.1
  dio: ^5.4.3+1
  hive: ^2.2.3
  hive_flutter: ^1.1.0
  flutter_svg: ^2.0.10+1
  cached_network_image: ^3.3.1
  intl: ^0.19.0
  expandable: ^5.0.1
  media_kit: ^1.1.10+1
  media_kit_libs_video: ^1.0.4
  media_kit_video: ^1.2.4
  flutter_audio_waveforms: ^1.2.1+8
  audioplayers: ^6.0.0
  http: ^1.2.1
  stomp_dart_client: ^2.0.0
  emoji_picker_flutter: ^2.2.0
  styled_text: ^8.1.0
  easy_rich_text: ^2.1.0
  flutter_markdown: ^0.7.2+1
  url_launcher: ^6.3.0
  enough_giphy: ^0.2.1
  file_picker: ^8.0.5
  desktop_drop: ^0.4.4
  video_thumbnail: ^0.5.3

dev_dependencies:
  flutter_test:
    sdk: flutter

  # The "flutter_lints" package below contains a set of recommended lints to
  # encourage good coding practices. The lint set provided by the package is
  # activated in the `analysis_options.yaml` file located at the root of your
  # package. See that file for information about deactivating specific lint
  # rules and activating additional ones.
  flutter_lints: ^3.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  # assets:
  #   - images/a_dot_burr.jpeg
  #   - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages
4A6F6F6E61 commented 5 months ago

If this doesn't work, try using a different computer or use a virtual machine and see if it works there.

4A6F6F6E61 commented 5 months ago

Hm. Maybe try adding the dependencies one by one and see which crashes the program.

iAkashPattnaik commented 5 months ago

ok

iAkashPattnaik commented 5 months ago

oh my god, the culprit was media_kit, removing that made it work. I literally just wasted an entire day on this.