无法在chrome上运行flutter项目

93ze6v8z  于 2022-12-27  发布在  Flutter
关注(0)|答案(1)|浏览(367)

我创建了一个样本Flutter项目,我想看看 chrome 的结果。
当我在chrome上运行main.dart时,我得到了一个白色的空白页面!
下面是我flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
Flutter (Channel stable, 3.3.0, on Ubuntu 22.04.1 LTS 5.15.0-56- 
generic,locale en_US.UTF-8)
Android toolchain - develop for Android devices
    cmdline-tools component is missing
    Run `path/to/sdkmanager --install "cmdline-tools;latest"`
    See https://developer.android.com/studio/command-line for more 
    details.
Chrome - develop for the web
Linux toolchain - develop for Linux desktop
    clang++ is required for Linux development.
    It is likely available from your distribution (e.g.: apt 
    install clang), or can be downloaded from 
    https://releases.llvm.org/
CMake is required for Linux development.
    It is likely available from your distribution (e.g.: apt 
    install cmake), or can be downloaded from 
    https://cmake.org/download/
ninja is required for Linux development.
    It is likely available from your distribution (e.g.: apt 
    install ninja-build), or can be downloaded from 
    https://github.com/ninja-build/ninja/releases
pkg-config is required for Linux development.
    It is likely available from your distribution (e.g.: apt 
    install pkg-config), or can be downloaded from 
    https://www.freedesktop.org/wiki/Software/pkg-config/
Android Studio
    android-studio-dir = 
    /home/mbunderline76/.local/share/JetBrains/Toolbox/apps/IDEA- 
    U/ch-0
Unable to find bundled Java version.
IntelliJ IDEA Ultimate Edition (version 2022.3)
Connected device (2 available)
HTTP Host Availability
Doctor found issues in 3 categories.

任何想法是怎么回事?顺便说一句,我正在使用Intellij的想法终极

f87krz0w

f87krz0w1#

首先解决这些问题。
Flutter command Line tools
Flutter Java Bundled Link
然后再次运行flutter doctor以确保这些错误消失。
然后在Vscode或AndroidStudio中运行flutter -v -d chrome run或选择“Chrome Web“。
希望这能成功,好好享受吧。

相关问题