skip to Main Content

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


  1. you have to accept the Android Licesses as showing at flutter doctor output

    1. Open the terminal
    2. run flutter doctor --android-licenses
    3. try to run the app again using flutter run command
    Login or Signup to reply.
  2. You didn’t add flutter to your path environment variables. This is usually done automatically but sometimes you need to do this manually

    • Locate Flutter Bin Directory and copy the full path
    • Open "Advanced system settings"
    • Click "Environment Variables"
    • Find the variable named "Path" and click Edit
    • Paste the full path of your Flutter bin (ex. "C:flutterbin")

    Always make sure that the the flutter & dart bin are added to your path variables.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search