skip to Main Content

I am new to Flutter.

I am now using VSCode IDE with Flutter extension.

With the flutter doctor -v, it shows OK except Windows apps which I don’t intent to develop.

Also, I have run some *.dart and it works fine.

[flutter] flutter doctor -v
[√] Flutter (Channel stable, 3.19.0, on Microsoft Windows [版本 10.0.22621.3155], locale zh-TW)
    • Flutter version 3.19.0 on channel stable at D:Downloadflutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision bae5e49bc2 (13 days ago), 2024-02-13 17:46:18 -0800
    • Engine revision 04817c99c9
    • Dart version 3.3.0
    • DevTools version 2.31.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:UsersAcerAppDataLocalAndroidsdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:Program FilesAndroidAndroid Studio1jbrbinjava
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:Program Files (x86)GoogleChromeApplicationchrome.exe

[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 2023.1)
    • Android Studio at C:Program FilesAndroidAndroid Studio1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)

[√] VS Code (version 1.86.2)
    • VS Code at C:UsersAcerAppDataLocalProgramsMicrosoft VS Code
    • Flutter extension version 3.82.0

[√] Connected device (4 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 8.0.0 (API 26) (emulator)
    • Windows (desktop)                  • windows       • windows-x64    • Microsoft Windows [版本 10.0.22621.3155]
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 122.0.6261.69
    • Edge (web)                         • edge          • web-javascript • Microsoft Edge 122.0.2365.52

[√] Network resources
    • All expected network resources are available.

Then, I create and connect to a android emulator (Pixel 6 API 34), after I Start Debugging the example from main.dart, it shows like the following snapshot.

https://imgur.com/7Jc5ji9.

And stuck at Launching libmain.dart on sdk gphone64 x86 64 in debug mode... forever.

Does anyone know what is happening here?

BR,

Tony.

If I change to connect to Chrome for web app, it works.

2

Answers


  1. Chosen as BEST ANSWER

    I think I found the root cause of failing to run on the android emulator.

    The failure signature is

    Your project path contains non-ASCII characters.
    

    By using commdline flutter run .libmain.dart instead of the Start Debugging button, the failing msg are printed.

    After change to a new dir, the android emulator are OK to use.

    Thanks for answering.


  2. Above problem specific to the Android emulator setup or the interaction between Flutter and the emulator. Here are several steps you can take to diagnose and resolve the issue.

    Update Flutter SDK

    Ensure your Flutter SDK is up to date. Sometimes, bugs that affect deployment to emulators are fixed in newer versions

    flutter upgrade
    

    Cold Boot the Emulator

    Sometimes, the emulator can get into a bad state.
    You can try cold booting it

    • Open the AVD Manager in Android Studio.
    • Find the emulator that’scausing problems.
    • Click on the dropdown menu on the right, and select "Cold Boot Now."

    Increase Emulator’s RAM

    If the emulator is running out of memory, it might fail to launch apps properly. Increase the allocated RAM.

    Installing Visual Studio for Windows Development

    Sometimes this warning might be causing this issue. Install it and check whether the above error still persist.

    Recreate the Emulator

    If none of the above steps work, try deleting the current emulator and creating a new one from the AVD Manager. Sometimes, emulator configurations can become corrupted.

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