8wDlpd.png
8wDFp9.png
8wDEOx.png
8wDMfH.png
8wDKte.png

VS Code 中的 Flutter 项目-java bin 无法运行

khady 1月前

6 0

我正在学习 Flutter,自从我上次接触该项目以来已经过去了几周,现在我又开始继续学习。出于习惯,我在 Ubuntu (24.04) 上安装了更新,但现在由于某种原因,java bin 无法运行...

我正在学习 Flutter,自从我上次接触该项目几周后,我决定继续学习。出于习惯,我在 Ubuntu (24.04) 上安装了更新,现在由于某种原因,java bin 无法运行。此外,当我尝试在不调试的情况下运行时,JAVA_HOME 未被读取。

另外由于某种原因,该 flutter doctor -v 命令并不彻底,因为我确实安装了 Android Studio 以及 Chrome。

注意:尝试在主机 (Linux) 设备上进行调试时,它至少会尝试启动一个窗口并完成这一步。对我来说,这几乎意味着 Android 设备模拟器没有访问 JAVA_HOME 路径。

[user]@workstation:~$ echo $JAVA_HOME
/usr/lib/jvm/java-1.21.0-openjdk-amd64
~/Projects/namer_app$ flutter doctor -v
[] Flutter (Channel stable, 3.22.3, on Freedesktop SDK 23.08 (Flatpak runtime) 6.8.0-41-generic, locale en_US.UTF-8)
    • Flutter version 3.22.3 on channel stable at /home/[user]/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b0850beeb2 (7 weeks ago), 2024-07-16 21:43:41 -0700
    • Engine revision 235db911ba
    • Dart version 3.4.4
    • DevTools version 2.34.3

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/[user]/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_SDK_ROOT = /home/[user]/Android/Sdk
    • Java binary at: /usr/lib/jvm/java-1.21.0-openjdk-amd64/bin/java
     Cannot execute /usr/lib/jvm/java-1.21.0-openjdk-amd64/bin/java to determine the version

[] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[] Connected device (1 available)
    • Linux (desktop) • linux • linux-x64 • Freedesktop SDK 23.08 (Flatpak runtime) 6.8.0-41-generic

[] Network resources
    • All expected network resources are available.

! Doctor found issues in 3 categories.
Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...

ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-1.21.0-openjdk-amd64

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

Error: Gradle task assembleDebug failed with exit code 1

Exited (1).
帖子版权声明 1、本帖标题:VS Code 中的 Flutter 项目-java bin 无法运行
    本站网址:http://xjnalaquan.com/
2、本网站的资源部分来源于网络,如有侵权,请联系站长进行删除处理。
3、会员发帖仅代表会员个人观点,并不代表本站赞同其观点和对其真实性负责。
4、本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
5、站长邮箱:yeweds@126.com 除非注明,本帖由khady在本站《ubuntu》版块原创发布, 转载请注明出处!
最新回复 (0)
返回
作者最近主题: