Flutter windows dektop与设备的连接丢失



我在windows 10上安装了flutter,创建了一个项目(默认(,该项目在chrome和edge中运行,但不是作为windows桌面应用程序,它在几秒钟后从windows框架开始(没有显示内容(报告

";与设备的连接丢失">

代码

import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}

flutter doctor -v 
[√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.19043.1865], locale en-IN)
• Flutter version 3.0.5 at C:srcflutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f1875d5 (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:UsersRajamohanAppDataLocalAndroidsdk
• Platform android-33, build-tools 33.0.0
• Java binary at: C:Program FilesAndroidAndroid Studiojrebinjava
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:Program FilesGoogleChromeApplicationchrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
• Visual Studio at C:Program FilesMicrosoft Visual Studio2022Community
• Visual Studio Community 2022 version 17.2.32630.192
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2021.2)
• Android Studio at C:Program FilesAndroidAndroid 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.0)
• VS Code at C:UsersRajamohanAppDataLocalProgramsMicrosoft VS Code
• Flutter extension version 3.46.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19043.1865]
• Chrome (web) • chrome • web-javascript • Google Chrome 103.0.5060.134
• Edge (web) • edge • web-javascript • Microsoft Edge 104.0.1293.47
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
C:flutter_appstest1>flutter --version
Flutter 3.0.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f1875d5 (4 weeks ago) • 2022-07-13 11:24:16 -0700
Engine • revision e85ea0e79c
Tools • Dart 2.17.6 • DevTools 2.12.2

没有看到任何错误或日志,附加了在详细模式下运行应用程序生成的完整日志。

在安装10号窗户的颤振时,我遗漏了什么吗?,在Linux下运行的设置与预期的一样。

颤振运行-d窗口-v日志

注意:windows 10作为来宾在虚拟机箱中运行,Linux Mint作为主机

好的,经过大量的测试和阅读,发现Virtualbox中3D支持的局限性,将windows guest迁移到Vmware播放器,现在flutter桌面应用程序正在正常构建和显示。

该问题仍然存在于安装在Virtualbox中的来宾操作系统中。

由于桌面现在正在运行,我将其标记为已解决

最新更新