I have trouble with run flutter app in virtual device, i can run virtual device normaly but can not run with flutter app
// My local.properties
sdk.dir=C:\Users\dat nguyen\AppData\Local\Android\sdk
flutter.sdk=C:\flutter
flutter.buildMode=debug
flutter.versionName=0.1.0
// My gradle.properties
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
C:Usersdat nguyen>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.22.2, on Microsoft Windows [Version 10.0.19045.4529], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[X] Chrome - develop for the web (Cannot find Chrome executable at .GoogleChromeApplicationchrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[X] Visual Studio - develop Windows apps
X Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2024.1)
[√] IntelliJ IDEA Community Edition (version 2024.1)
[√] Connected device (3 available)
[√] Network resources
! Doctor found issues in 3 categories.
When i run flutter in always thrown this error
Launching libmain.dart on sdk gphone x86 in debug mode...
'D:flutter' is not recognized as an internal or external command,
operable program or batch file.
Error: Gradle task assembleDebug failed with exit code 1
Run flutter app in virtal device, I want to run this but it always thrown error
2
Answers
you have to accept the Android Licesses as showing at flutter doctor output
flutter doctor --android-licenses
flutter run
commandYou didn’t add flutter to your path environment variables. This is usually done automatically but sometimes you need to do this manually
Always make sure that the the flutter & dart bin are added to your path variables.