Skip to content
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

Lost connection to device #21

Open
Andregrps opened this issue Jul 16, 2021 · 8 comments
Open

Lost connection to device #21

Andregrps opened this issue Jul 16, 2021 · 8 comments

Comments

@Andregrps
Copy link

When trying to get the device id from the windows desktop, a few seconds later it is crashing, and closing the application without showing any error log.

Currently my project is not null safety!

flutter doctor -v
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [versão 10.0.19042.1083], locale pt-BR)
    • Flutter version 2.2.3 at C:\Users\progmaq02\Documents\src\flutter
    • Framework revision f4abaa0735 (2 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\progmaq02\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

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

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.9.31129.286
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 4.1.0)
    • 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 1.8.0_242-release-1644-b01)

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

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [versão 10.0.19042.1083]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 91.0.4472.124
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 91.0.864.67
@zhibaiwei
Copy link

I also found the same problem,Currently my project is null safety!

@Ali-Fadaei
Copy link

i have same problem!

@iommi87
Copy link

iommi87 commented Mar 31, 2022

Same problem.

@Ali-Fadaei
Copy link

any update?!

@Dusk-afk
Copy link

I found a solution. Thanks to @wangbax from here.

Just use this SIMPLE function in your flutter windows app

import 'dart:convert';
import 'dart:io';

Future<String> getBiosID() async {
  String biosID = '';
  final process = await Process.start(
    'wmic',
    ['csproduct', 'get', 'uuid'],
    mode: ProcessStartMode.detachedWithStdio,
  );
  final result = await process.stdout.transform(utf8.decoder).toList();
  for (var element in result) {
    final item = element.replaceAll(RegExp('\r|\n|\\s|UUID|uuid'), '');
    if (item.isNotEmpty) {
      biosID = item;
    }
  }
  return biosID;
}

This will return the exact same result that the plugin does. Plus, it also removes the terminal window pop up.
Also you don't even need to use this platform_device_id package.

@DomingoMG
Copy link

The solution offered is valid for the following platforms: Windows, MacOS and Linux?

Is it only specifically Windows?

@Dusk-afk
Copy link

Dusk-afk commented Dec 8, 2022

The solution offered is valid for the following platforms: Windows, MacOS and Linux?

Is it only specifically Windows?

  • Tested on windows (working like a charm)
  • I don't know about Linux
  • Pretty sure it's not gonna work on macOS (edit: Working on MacOS as well)

@nikitatg
Copy link

nikitatg commented Dec 8, 2022

The solution offered is valid for the following platforms: Windows, MacOS and Linux?

Is it only specifically Windows?

Tested on Windows 10/11, Ubuntu 20 and MacOS. Works well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants