-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Flutter application cannot start if it has this plugin and there is no bluetooth dongle inserted into the Windows computer. #127
Comments
i am facing the same issue can not run build windows application with this plugin any solution ? |
As far as I understand, the application crashes on a level inaccessible for flutter when it try to load this plugin in the absence of a bluetooth device in OS. I did not find any workaround, it is impossible even to display any dialog with error message to the user. I suggest, the problem can only be solved inside the plugin by adding a check for the presence of a BT device before any attempt calling it. |
I faced the same issue and did a little debugging. I could fix it by simply adding a null check:
New:
However, take this advise with a grain of salt as I am by no means a C++ or Windows System programmer. There might be a better solution, but I got it working with this fix. |
Great, it works! quick_blue: Updated: Now the solution above does not work, I request the author of the plugin merge the solution to master branch. |
Issue woodemi#127: The Flutter application cannot start if it has this plugin and there is no bluetooth dongle inserted into the Windows computer.
Thanks for this fix, it works like a charm!
In my opinion it is a simple and effective solution: if nothing else, with this patch you can launch the application even if bluetooth is disabled. Then you can check the controller activation after the UI comes up (maybe via isBluetoothAvailable static method.
@alevlako, you can get it working only if you apply your fork as dep override, rather than the entire package replacement: dependencies:
flutter:
sdk: flutter
quick_blue: ^0.5.0-dev.2 # leave here the federated plugin
...
dependency_overrides:
quick_blue_windows:
git:
url: https://github.com/alevlako/quick_blue.git
ref: issue_127_fix # branch name
path: quick_blue_windows # Folder Path on Github Otherwise flutter cannot build the expected patch, since the resulting dep chain is not the desired one. In other words, I think your pull-request is to be made for the quick_blue_windows sub-project... 😉 |
How to reproduce:
The text was updated successfully, but these errors were encountered: