Flutter Installation Problem Android Studio on Windows

 Recently for my WISP project and providing job services project I had to build an app that uses flutter. This was something new to me and it is perhaps widely used nowadays. As an electronic engineer we also have to have experience in the field of website, server, forehand and backend programming languages, databases etc. It is especially becoming important are hardware are ultimately connected to the internet. For example in IoT(Internet of Things) where sensors are connected to micontrollers like ATmega328P, Arduino Nano 33 BLE, NodeMCU modules which communicates with mobile phones and PC which will be running the flutter application.

I followed the instruction to install flutter on windows which is provided during the app installation. However during the flutter installation I got bit stuck. First we have to download the flutter SDK file and unzip in some suitable folder like c:\flutter. Thereafter we have to configure the user environment path to the bin folder of flutter like path: c:\flutter\bin. Afterwards we have to run >flutter doctor and it is here where I got the following messages:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.19.0, on Microsoft Windows [Version 10.0.19043.2364], 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 cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    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.
[√] Chrome - develop for the web
[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 2022.3)
[√] VS Code (version 1.70.3)
[√] Connected device (3 available)
[√] Network resources 

flutter sdk errors 2

It seems like you have a couple of issues reported by Flutter doctor related to your Android toolchain and Visual Studio. Here's how you can address them:

Android toolchain iss
ue
 

It reports that the cmdline-tools component is missing. You can install it by running the following command in your terminal:  

path/to/sdkmanager --install "cmdline-tools;latest"
 
  • Replace path/to/sdkmanager with the actual path to your Android SDK manager executable. Typically, it's located in the tools/bin directory of your Android SDK installation(C:\Users\john\AppData\Local\Android\Sdk\tools\bin).
  • For example:
    PS D:\customer> C:\Users\john\AppData\Local\Android\Sdk\tools\bin\sdkmanager --install "cmdline-too
    ls;latest"
     
  • After installing the cmdline-tools component, you may need to accept the Android SDK licenses. You can do this by running:
  •         flutter doctor --android-licenses
     Follow the prompts to accept the licenses.
     
    After this if we run flutter doctor again we can see that the first problem was solved. See the attached screenshot.
     
    flutter sdk errors 2

     
    Visual Studio issue:
    • Flutter doctor reports that Visual Studio is not installed, which is necessary for developing Windows apps.
    • You can download Visual Studio from https://visualstudio.microsoft.com/downloads/.
    • During installation, make sure to select the "Desktop development with C++" workload and include all of its default components.

    Once you've addressed these issues, run flutter doctor again to ensure everything is set up correctly. If there are still issues, the output from flutter doctor should provide more specific guidance on how to resolve them.

    See also 

    Post a Comment

    Previous Post Next Post