Unable to complete Flutter installation
It looks like Flutter doesn't know where to look for the SDK. Did you update your path ?
Qwerty
Updated on December 16, 2022Comments
-
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.So, I downloaded this zip file from https://developer.android.com/studio/index.html#downloads
and manually placed the
tools
folder here -C:\src\android_sdk\tools
The tools folder has these files:
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:
- Included the path
C:\src\android_sdk\tools
for thePath
variable inSystem Variables
. - Added the variable
ANDROID_HOME
in System Variables with the valueC:\src\android_sdk\tools
. -
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"
Downloaded the platform tools and extracted the contents of the file to
C:\src\android_sdk\tools\platform-tools\
- Followed the step by ipereto here, which is to run a command in powershell. It created platforms & platform-tool folders.
- 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.-
Sanket Vekariya over 4 yearsI have faced exactly same issue and solved it from below: c-sharpcorner.com/blogs/…
- Included the path
-
Qwerty over 4 yearsI tried adding this to 'Path' of User variables -
C:\Users\<username>\AppData\Local\Android\android_sdk\tools\bin
. No luck. -
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 over 4 yearsFor the first step, you mean to add under user variables & the second step is for system variables. right?
-
Qwerty over 4 yearsI 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 over 4 yearsTry to extract everything from the SDK zip into your android_sdk folder and edit the paths to point to that folder.
-
Qwerty over 4 yearsI did that & also ran this command -
flutter config --android-sdk "C:\Users\<username>\AppData\Local\Android\android_sdk"
. Did not work -
MickaelHrndz over 4 yearsDid you reboot the computer ? And just to be sure, do you replace <username> with your actual username ?
-
Qwerty over 4 yearsYes to both. It still says android sdk not found at that location.
-
MickaelHrndz over 4 yearsI 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 over 4 yearsremove everything and install JDK first and set system variables.Then Install flutter and set VS code accordingly!