I get this error when trying to run an app via flutter on vscode

Viewed 706

I just finished setting flutter up in VS Code, I created an android emulator and it runs fine, but when i try to launch the demo app of flutter i get this error:

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)

What's the problem?

1 Answers

Install Android Studio, it is a must if you are new, you can always use VSCODE for development but Android studio needs to be there.

Best way is uninstall vscode, install android studio, install flutter and dart plugin in android studio, then install vscode, it will work.

Also try running

flutter doctor

What does it say?

Related