Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 颤振:异常:渐变任务AssembledBug失败,退出代码1退出(sigterm)_Flutter - Fatal编程技术网

Flutter 颤振:异常:渐变任务AssembledBug失败,退出代码1退出(sigterm)

Flutter 颤振:异常:渐变任务AssembledBug失败,退出代码1退出(sigterm),flutter,Flutter,我的代码中没有错误。 因此,当代码运行时,它会出现在调试控制台中: launching lib\main.dart on AOSP on IA Emulator in debug mode... ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match t

我的代码中没有错误。 因此,当代码运行时,它会出现在调试控制台中:

  launching lib\main.dart on AOSP on IA Emulator in debug mode...
   ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
    Please set the JAVA_HOME variable in your environment to match the
   location of your Java installation.
   Exception: Gradle task assembleDebug failed with exit code 1
   Exited (sigterm)
然后它停止发射

我打开命令提示符,然后在其中写下“颤振医生” 在我看来

  C:\Users\Dell>flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
   [√] Flutter (Channel stable, 1.20.2, on Microsoft Windows [Version 10.0.18362.53], locale en-US)
   [!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    X No Java Development Kit (JDK) found; You must have the environment variable JAVA_HOME set and 
    the java binary in
  your PATH. You can download the JDK from https://www.oracle.com/technetwork/java/javase/downloads/.
   [!] Android Studio (not installed)
   [√] VS Code (version 1.48.2)
   [√] Connected device (1 available)

   ! Doctor found issues in 2 categories.
然后,我在命令提示符下编写了 “颤振升级-强制” 为了确保我写的“颤振升级”出现在我面前,他进行了更新

 Flutter is already up to date on channel stable
  Flutter 1.20.2 • channel stable • https://github.com/flutter/flutter.git
   Framework • revision bbfbf1770c (3 weeks ago) • 2020-08-13 08:33:09 -0700
   Engine • revision 9d5b21729f
    Tools • Dart 2.9.1
然后我返回到vscode来运行代码,但我发现了相同的错误

   launching lib\main.dart on AOSP on IA Emulator in debug mode...
   ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
    Please set the JAVA_HOME variable in your environment to match the
   location of your Java installation.
   Exception: Gradle task assembleDebug failed with exit code 1
   Exited (sigterm)

我不知道该怎么做才能使它工作

我认为需要将JRE路径设置到环境变量中的path变量中。如果你已经安装了android studio,你可以从那里获得JRE路径。检查图片下方


我认为您需要将JRE路径设置到环境变量中的path变量中。如果你已经安装了android studio,你可以从那里获得JRE路径。检查图片下方


如果您安装了java,请按照此操作;如果您没有安装java,请按照链接中的教程操作。您的错误:未设置java_HOME,并且在您的路径中找不到“java”命令。我安装了java,并按照此链接操作,但在推荐提示的最后一步中,我在链接中编写了“echo%java_HOME%”,但在我编写时,在链接中显示了相同的内容“javac-version”在我看来“javac”不被识别为内部或外部命令、可操作程序或批处理文件。“这与link中的屏幕截图不同,然后我返回到我的代码运行,在我看来是相同的错误如果你安装了java,那么按照这个操作,如果你没有,安装Java并按照链接中的教程进行操作。您的错误:未设置Java_HOME,在您的路径中找不到任何“Java”命令。我安装了Java并按照此链接进行操作,但在推荐提示的最后一步中,我编写了“echo%Java_HOME%”,我在链接中看到了相同的内容,但在编写“javac-version”时看到了相同的内容“javac”不被识别为内部或外部命令、可操作程序或批处理文件。”这与link中的屏幕截图不同。然后我返回代码运行,在我看来是相同的错误