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

demo不能在Windows上运行 #633

Open
1 task done
huangsir0 opened this issue Jul 18, 2024 · 0 comments
Open
1 task done

demo不能在Windows上运行 #633

huangsir0 opened this issue Jul 18, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@huangsir0
Copy link

Affected version

0.16.1

Flutter versions

3.22.1

No same issues found.

  • Yes, I search all issues but not found.

Steps to Reproduce

在windows 运行以下代码,我Windows11 64位系统。

Code example

/*
 * Copyright (C) 2019-2022 The Kraken authors. All rights reserved.
 * Copyright (C) 2022-present The WebF authors. All rights reserved.
 */

import 'package:flutter/material.dart';
import 'package:webf/devtools.dart';
import 'package:webf/webf.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Kraken Browser',
      // theme: ThemeData.dark(),
      debugShowCheckedModeBanner: false,
      home: FirstPage(title: 'Landing Bay'),
    );
  }
}

class FirstPage extends StatefulWidget {
  const FirstPage({Key? key, required this.title}) : super(key: key);
  final String title;

  @override
  State<StatefulWidget> createState() {
    return FirstPageState();
  }
}

class FirstPageState extends State<FirstPage> {
  late WebFController controller;

  @override
  void didChangeDependencies() {
    super.didChangeDependencies();
    controller = WebFController(
      context,
      devToolsService: ChromeDevToolsService(),
    );

    controller.preload(
        WebFBundle.fromUrl('https://www.baidu.com')); // The page entry point
  }

  @override
  void dispose() {
    super.dispose();
    controller.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: ElevatedButton(
          onPressed: () {
            Navigator.push(context, MaterialPageRoute(builder: (context) {
              return WebFDemo(controller: controller);
            }));
          },
          child: const Text('Open WebF Page'),
        ),
      ),
    );
  }
}

class WebFDemo extends StatelessWidget {
  final WebFController controller;

  WebFDemo({required this.controller});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('WebF Demo'),
        ),
        body: Center(
          // Center is a layout widget. It takes a single child and positions it
          // in the middle of the parent.
          child: WebF(controller: controller),
        ));
  }
}

Expected results

希望能正常运行

Actual results

[  +44 ms] Building Windows application... (completed in 39.2s)
[   +2 ms] √ Built build\windows\x64\runner\Debug\walang.exe
[ +193 ms] VM Service URL on device: http://127.0.0.1:62445/qveTu-fAfNk=/
[   +1 ms] Caching compiled dill
[  +53 ms] Connecting to service protocol: http://127.0.0.1:62445/qveTu-fAfNk=/
[        ]     0 ������
[        ] ����ʱ�� 00:00:34.69
[  +44 ms] Building Windows application... (completed in 39.2s)
[   +2 ms] √ Built build\windows\x64\runner\Debug\walang.exe
[ +193 ms] VM Service URL on device: http://127.0.0.1:62445/qveTu-fAfNk=/
[   +1 ms] Caching compiled dill
[  +53 ms] Connecting to service protocol: http://127.0.0.1:62445/qveTu-fAfNk=/
[        ] ����ʱ�� 00:00:34.69
[  +44 ms] Building Windows application... (completed in 39.2s)
[   +2 ms] √ Built build\windows\x64\runner\Debug\walang.exe
[ +193 ms] VM Service URL on device: http://127.0.0.1:62445/qveTu-fAfNk=/
[   +1 ms] Caching compiled dill
[  +53 ms] Connecting to service protocol: http://127.0.0.1:62445/qveTu-fAfNk=/
[   +2 ms] √ Built build\windows\x64\runner\Debug\walang.exe
[ +193 ms] VM Service URL on device: http://127.0.0.1:62445/qveTu-fAfNk=/
[   +1 ms] Caching compiled dill
[  +53 ms] Connecting to service protocol: http://127.0.0.1:62445/qveTu-fAfNk=/
[  +85 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at http://127.0.0.1:62445/qveTu-fAfNk=/.
[ +193 ms] VM Service URL on device: http://127.0.0.1:62445/qveTu-fAfNk=/
[   +1 ms] Caching compiled dill
[  +53 ms] Connecting to service protocol: http://127.0.0.1:62445/qveTu-fAfNk=/
[  +85 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at http://127.0.0.1:62445/qveTu-fAfNk=/.
[   +1 ms] Caching compiled dill
[  +53 ms] Connecting to service protocol: http://127.0.0.1:62445/qveTu-fAfNk=/
[  +85 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at http://127.0.0.1:62445/qveTu-fAfNk=/.
[  +85 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at http://127.0.0.1:62445/qveTu-fAfNk=/.
[  +35 ms] DDS is listening at http://127.0.0.1:62449/SYd_TrI-y_w=/.
[  +35 ms] DDS is listening at http://127.0.0.1:62449/SYd_TrI-y_w=/.
[  +59 ms] Successfully connected to service protocol: http://127.0.0.1:62445/qveTu-fAfNk=/
[  +59 ms] Successfully connected to service protocol: http://127.0.0.1:62445/qveTu-fAfNk=/
[  +14 ms] DevFS: Creating new filesystem on the device (null)
[  +14 ms] DevFS: Created new filesystem on the device (file:///C:/Users/Admin/AppData/Local/Temp/walang5c7ee13e/walang/)
[   +3 ms] Updating assets
[  +14 ms] DevFS: Creating new filesystem on the device (null)
[  +14 ms] DevFS: Created new filesystem on the device (file:///C:/Users/Admin/AppData/Local/Temp/walang5c7ee13e/walang/)
[   +3 ms] Updating assets
[   +3 ms] Updating assets
[ +264 ms] Manifest contained wildcard assets. Inserting missing file into build graph to force rerun. for more information see #56466.
[   +2 ms] Syncing files to device Windows...
[   +1 ms] Compiling dart to kernel with 0 updated files
[   +1 ms] Compiling dart to kernel with 0 updated files
[        ] Processing bundle.
[        ] Processing bundle.
[        ] <- recompile package:walang/main.dart 31c6ce02-de4a-44cb-bf13-2f7f8fb83b8b
[        ] <- recompile package:walang/main.dart 31c6ce02-de4a-44cb-bf13-2f7f8fb83b8b
[        ] <- 31c6ce02-de4a-44cb-bf13-2f7f8fb83b8b
[        ] <- 31c6ce02-de4a-44cb-bf13-2f7f8fb83b8b
[  +12 ms] Bundle processing done.
[ +113 ms] Updating files.
[        ] DevFS: Sync finished
[        ] Syncing files to device Windows... (completed in 130ms)
[        ] Synced 0.0MB.
[        ] Synced 0.0MB.
[        ] <- accept
[  +33 ms] Connected to _flutterView/0x26b6a7ab8e0.
[  +33 ms] Connected to _flutterView/0x26b6a7ab8e0.
[   +1 ms] Flutter run key commands.
[        ] r Hot reload. 
[        ] R Hot restart.
[        ] h List all available interactive commands.
[        ] d Detach (terminate "flutter run" but leave application running).
[        ] c Clear the screen
[        ] q Quit (terminate the application on the device).
[        ] A Dart VM Service on Windows is available at: http://127.0.0.1:62449/SYd_TrI-y_w=/
[ +579 ms] Service protocol connection closed.
[   +2 ms] Lost connection to device.
[   +1 ms] DevFS: Deleting filesystem on the device (file:///C:/Users/Admin/AppData/Local/Temp/walang5c7ee13e/walang/)
[ +266 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed

[   +2 ms] "flutter run" took 46,099ms.
[ +310 ms] ensureAnalyticsSent: 252ms
[        ] Running 1 shutdown hook
[  +11 ms] Shutdown hooks complete
[  +58 ms] exiting with code 0
@huangsir0 huangsir0 added the bug Something isn't working label Jul 18, 2024
@andycall andycall self-assigned this Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants