尝试在 vscode 上通过 flutter 运行应用程序时出现此错误

时间:2021-07-11 09:44:10

标签: android flutter visual-studio-code

我刚刚在 VS Code 中完成了 flutter 的设置,我创建了一个 android 模拟器并且它运行良好,但是当我尝试启动 flutter 的演示应用程序时,我收到此错误:

Launching lib\main.dart on AOSP on IA Emulator in debug mode...
Parameter format not correct -

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Kotlin could not find the required JDK tools in the Java installation 'C:\Program Files\Java\jre1.8.0_291' used by Gradle. Make sure Gradle is running on a JDK, not JRE.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org

BUILD FAILED in 4s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

有什么问题吗?

1 个答案:

答案 0 :(得分:0)

安装Android Studio,新手必备,VSCODE开发可以随时使用,但Android studio必须要有。

最好的方法是卸载vscode,安装android studio,在android studio中安装flutter和dart插件,然后安装vscode,就可以了。

也尝试跑步

扑医生

它说了什么?