Unable to complete Flutter installation

2,234

It looks like Flutter doesn't know where to look for the SDK. Did you update your path ?

Share:
2,234
Qwerty
Author by

Qwerty

Updated on December 16, 2022

Comments

  • Qwerty
    Qwerty over 1 year

    I have installed the Flutter plugin 3.7.1 to VS code along with Dart 3.7.1, and two other Android related plugins.

    When I run the Flutter Doctor command, it shows 3 issues and one of them is - Android SDK not found.

    enter image description here

    So, I downloaded this zip file from https://developer.android.com/studio/index.html#downloads

    enter image description here

    and manually placed the tools folder here - C:\src\android_sdk\tools

    The tools folder has these files:

    enter image description here

    Running the Flutter Doctor command still shows the same reminder. Also When I run Create Android Emulator, it shows the error - Invalid argument(s): Cannot find executable for null.

    Did I download the correct Android SDK package.

    I do not know how to code in Java and hence would like to stick with VS Code. How can I solve these issues and get started.

    Steps I have tried so far:

    1. Included the path C:\src\android_sdk\tools for the Path variable in System Variables.
    2. Added the variable ANDROID_HOME in System Variables with the value C:\src\android_sdk\tools.
    3. Executed these commands in the Windows command prompt, which said - path updated and any open editor should be restarted to take effect:

      C:\src\flutter\bin>flutter config --android-sdk C:\src\android_sdk\tools C:\src\flutter\bin>flutter config --android-sdk "C:\src\android_sdk\tools" C:\src\flutter>flutter config --android-sdk C:\src\android_sdk\tools C:\src\flutter>flutter config --android-sdk "C:\src\android_sdk\tools"

    4. Downloaded the platform tools and extracted the contents of the file to C:\src\android_sdk\tools\platform-tools\

    5. Followed the step by ipereto here, which is to run a command in powershell. It created platforms & platform-tool folders.
    6. Restarted the system.

    Running flutter doctor in VS code still shows the same error.

    UPDATE:
    Android Studio is a must for Flutter to work. I missed this point. After installing Android Studio, Flutter & Dart plugins are to be installed in it. Then VS Code flutter doctor command did not show those errors.

  • Qwerty
    Qwerty over 4 years
    I tried adding this to 'Path' of User variables - C:\Users\<username>\AppData\Local\Android\android_sdk\tools\‌​bin. No luck.
  • MickaelHrndz
    MickaelHrndz over 4 years
    - Type "env" in the Windows search, click "Edit environment variables for your account" and then "Environment variables". - Copy the SDK path (C:\ ... \android_sdk\tools). Under "System variables" : - Select the row named "Path", click Edit, New and paste the path. - Create a new system variable named "ANDROID_HOME" and paste the path as the value. - You might need to reboot your computer but this should do it.
  • Qwerty
    Qwerty over 4 years
    For the first step, you mean to add under user variables & the second step is for system variables. right?
  • Qwerty
    Qwerty over 4 years
    I added ANDROID_HOME value as a system variable - & the new error is ANDROID_HOME = C:\Users\<username>\AppData\Local\Android\android_sdk\tools\ but Android SDK not found at this location.
  • MickaelHrndz
    MickaelHrndz over 4 years
    Try to extract everything from the SDK zip into your android_sdk folder and edit the paths to point to that folder.
  • Qwerty
    Qwerty over 4 years
    I did that & also ran this command - flutter config --android-sdk "C:\Users\<username>\AppData\Local\Android\android_sdk". Did not work
  • MickaelHrndz
    MickaelHrndz over 4 years
    Did you reboot the computer ? And just to be sure, do you replace <username> with your actual username ?
  • Qwerty
    Qwerty over 4 years
    Yes to both. It still says android sdk not found at that location.
  • MickaelHrndz
    MickaelHrndz over 4 years
    I just figured I didn't clarify that both variables are system variables, maybe that's it. If not, I don't know how else I can help, sorry. Maybe try with Android Studio ?
  • Mustufa Ansari
    Mustufa Ansari over 4 years
    remove everything and install JDK first and set system variables.Then Install flutter and set VS code accordingly!