How to Fix “Flutter Directory Is Not a Clone of the GitHub Project” in Flutter
If you are trying to run flutter doctor, open a Flutter project in Android Studio, or use FVM and suddenly see this error:
Error: The Flutter directory is not a clone of the GitHub project.
The flutter tool requires Git in order to operate properly;
to install Flutter, see the instructions at:
https://flutter.dev/get-started
you are not alone.
This is one of the most confusing Flutter setup errors because it usually appears when the Flutter SDK path looks correct, but the SDK folder you are using is either incomplete, damaged, pointed at the wrong directory, or being resolved through an invalid FVM cache. Flutter’s tooling still depends on Git metadata in important scenarios, and the Flutter team’s own error text points directly to that dependency.
In this guide, I will explain what this error actually means, why it happens, and how to fix it properly on Windows, especially if you use Android Studio, VS Code, or FVM.
What this Flutter error actually means
This error does not simply mean “Git is missing.” It means the Flutter command is being run against a directory that Flutter does not recognize as a valid SDK checkout with the repository information it expects. The Flutter issue tracker shows the exact error text, and FVM’s advanced documentation also warns that Flutter tools depend on repository references to determine the correct SDK version.
In practical terms, the error usually happens because of one of these reasons:
- Git is not installed correctly or not available in PATH.
- Your IDE is pointing to the wrong Flutter SDK folder.
- A Flutter SDK folder was copied, moved, partially extracted, or corrupted.
- An FVM-managed SDK version is broken or incomplete.
- Android Studio is resolving an FVM symlink to a stale or invalid SDK location.
- You are running
fvm flutterin a folder that is not actually configured as a Flutter project.
Read : Flutter FVM – Complete Guide to FVM (Flutter Version Management)
The most common root causes
1. Git is missing or not accessible
Flutter’s installation documentation lists Git as prerequisite software, including Git for Windows on Windows machines. If Git is missing or not correctly exposed through PATH, Flutter commands can fail in ways that look like SDK issues.
First, confirm Git works:
git --version
If this command fails, install Git first and reopen your terminal.
Read : Download Git for Flutter for Windows, Linux and macOS: Complete Step-by-Step Guide
2. Your IDE is pointing to the wrong Flutter SDK path
This is extremely common with Android Studio and IntelliJ. If you use FVM, the recommended SDK path for a project is the project-local symlink:
<project-folder>\.fvm\flutter_sdk
FVM explicitly recommends pointing IDEs to the project’s .fvm/flutter_sdk symlink and recreating it with fvm use <version> if it is missing. FVM’s workflow guide also says each module should reference its own .fvm/flutter_sdk instead of a shared global install.
Read : How to Set Flutter Path in Windows (Step-by-Step Guide for Beginners)
3. A broken or incomplete Flutter SDK directory
FVM’s documentation warns that Flutter tools depend on repository references and that incomplete clone strategies such as --depth or --single-branch can cause issues with SDK validation. That warning is specifically about custom SDK handling, but it reveals the core reason behind this error: Flutter expects repository information to be intact.
So if your SDK folder was manually copied from somewhere else, partially downloaded, or damaged by antivirus or a failed extraction, Flutter may reject it.
Read : Download Flutter SDK (Windows) — Also for Mac & Linux
4. FVM is resolving a project version instead of your global Flutter install
FVM does not simply use whatever flutter is in your system PATH. Its resolution order prioritizes:
- project
.fvmrc - ancestor
.fvmrc - global FVM version
- system PATH Flutter
That means you may think you are using C:\flutter, but your project may actually be using an FVM-managed SDK instead.
Step-by-step fix for this Flutter error
Step 1: Check whether Git is installed correctly
Run:
git --version
If you see a valid version, move to the next step.
If not, install Git for Windows, then restart Command Prompt, PowerShell, Android Studio, or VS Code. Flutter’s install docs list Git as a required prerequisite.
Step 2: Verify which Flutter SDK you are actually using
Run these commands:
where flutter
where git
flutter --version
On Windows, where flutter tells you which executable is being picked first. This matters because you may have:
- a global Flutter install such as
C:\flutter - an older Flutter install in another folder
- an FVM-managed version being used indirectly inside a project
If the path is not the one you expect, that is your first problem.
Step 3: If you use FVM, run commands inside the project root
A very common mistake is running fvm doctor from C:\Users\YourName or another parent folder instead of the app directory.
Run:
cd D:\your_project
fvm doctor
If you run it outside the project, FVM may tell you there is no Flutter project, no .fvmrc, and no local configuration. FVM’s own FAQ says the project needs a configured version and the .fvm directory to exist.
Read : Flutter Doctor command — What is flutter doctor (2026 Complete Guide)
Step 4: Recreate the FVM symlink if you use FVM
Inside the project root, run:
fvm use 3.35.4
Replace 3.35.4 with your required version.
FVM’s configuration docs state that if .fvm/flutter_sdk is missing, running fvm use <version> in the project root recreates the symlink.
After that, use:
fvm flutter doctor
not just:
flutter doctor
This ensures the project-specific SDK is the one being tested.
Step 5: Point Android Studio to the correct SDK path
If your project uses FVM, do not point Android Studio directly to something like this:
C:\Users\user\fvm\versions\3.35.4
Instead, point it to:
D:\your_project\.fvm\flutter_sdk
FVM’s workflow documentation says each module should reference its own .fvm/flutter_sdk path rather than a shared global install.
After changing the path:
- click Apply
- restart Android Studio
- sync Gradle
- reopen the project if needed
Step 6: If the FVM SDK cache is broken, reinstall that version
If fvm flutter doctor still throws the same error, the cached SDK may be damaged.
Inside your project, run:
fvm remove 3.35.4
fvm install 3.35.4
fvm use 3.35.4
fvm flutter doctor -v
This forces FVM to download and bind a fresh SDK copy for the project. Since FVM is designed to manage project versions while a global Flutter install remains available on the machine, reinstalling the affected project version is often the cleanest fix.
Step 7: If you do not use FVM, repair your global Flutter install
If you use a normal global Flutter setup, the safest approach is to reinstall Flutter using the current official installation method.
Flutter’s manual install documentation says to install prerequisite software, then download the current SDK bundle and extract it into a suitable folder such as %USERPROFILE%\develop, avoiding special characters, spaces, and elevated-permission directories.
A clean reinstall flow looks like this:
- rename your current broken folder, for example:
C:\flutter_old - install Flutter fresh in:
C:\flutteror%USERPROFILE%\develop\flutter - add the new
binfolder to PATH - reopen terminal
- run:
flutter doctor
Step 8: Check antivirus or incomplete extraction issues
Flutter’s manual installation guide notes that if flutter.bat is missing after extraction, antivirus software may have quarantined files, and the SDK should be re-extracted after trusting the Flutter directory.
This matters because a broken SDK folder can trigger misleading validation errors. If your installation was interrupted, partially extracted, or modified by security software, reinstall the SDK cleanly.
Best fixes by scenario
Scenario 1: You use global Flutter only
Use this checklist:
git --version
where flutter
flutter --version
flutter doctor
If the error remains:
- reinstall Flutter cleanly
- confirm PATH points to the correct
bin - reopen terminal and IDE
Scenario 2: You use FVM in a Flutter project
Use this checklist:
cd D:\your_project
fvm doctor
fvm use 3.35.4
fvm flutter doctor -v
Then make sure your IDE uses:
D:\your_project\.fvm\flutter_sdk
FVM’s docs are clear that the project-local .fvm/flutter_sdk path is the correct one for IDE integration.
Scenario 3: Android Studio keeps changing the SDK path back
This usually happens because Android Studio resolves symlinks and stores the underlying target path. With FVM projects, that behavior can look confusing, but the important part is that the project is correctly configured and the .fvm/flutter_sdk symlink is valid. FVM’s workflow and configuration docs specifically center IDE setup around the project-local symlink and cache refresh after switching versions.
Read : Android Studio Download and Android SDK Setup steps for Flutter Development
Scenario 4: fvm doctor says “Is Flutter Project: No”
Then you are not in the project root. Move into the actual Flutter app folder and run the command again. FVM’s FAQ makes it clear that project configuration and the .fvm directory must exist for project-level commands to work as expected.
Recommended fix commands for Windows
For a global Flutter installation
git --version
where flutter
flutter --version
flutter doctor
For an FVM-managed project
cd D:\your_project
fvm doctor
fvm use 3.35.4
fvm flutter doctor -v
If the cached FVM SDK is corrupted
cd D:\your_project
fvm remove 3.35.4
fvm install 3.35.4
fvm use 3.35.4
fvm flutter doctor -v
How to prevent this error in the future
The best prevention strategy is simple.
1. Keep one clean global Flutter install
FVM itself recommends having the Flutter SDK installed globally using the official guide, then using FVM to manage project-specific versions.
2. If you use FVM, always configure the project locally
Run fvm use <version> in the project root so .fvm/flutter_sdk is created and stable.
3. Point your IDE to .fvm/flutter_sdk, not random cache folders
That is the path FVM documents for Android Studio and IntelliJ workflows.
4. Do not rely on copied or partial SDK folders
FVM’s advanced documentation warns that incomplete clone approaches can break Flutter tool validation because repository references matter.
5. Reopen your IDE after SDK path changes
When switching versions in FVM-managed projects, FVM recommends refreshing the IDE workflow and sync state.
Final takeaway
The error “Flutter directory is not a clone of the GitHub project” usually means Flutter is looking at the wrong SDK folder, an incomplete SDK, or a broken FVM-managed version, not just a missing package or random IDE bug. Flutter requires Git as part of its installation prerequisites, and FVM-managed projects must use the correct .fvm/flutter_sdk path to work reliably.
So the real fix is not to keep changing paths blindly.
The real fix is to answer these three questions in order:
- Is Git installed and available?
- Which Flutter SDK is actually being used?
- Is that SDK a valid global install or a valid FVM project SDK?
Once those three are clear, this error becomes straightforward to solve.
FAQ
Because the SDK path you are using does not contain the repository information Flutter expects, or the SDK is broken, incomplete, or incorrectly resolved through FVM or the IDE.
Yes. Git may be installed, but Flutter may still be pointing to an invalid SDK directory or damaged FVM cache. Git alone does not fix a broken SDK path.
Use the project-local path:
<project-folder>\.fvm\flutter_sdk
That is the path documented by FVM for IDE workflows.
Because IDEs may resolve symlinks to their real target paths. In FVM projects, the important thing is that .fvm/flutter_sdk is valid and the project version is correctly configured.
Use both correctly: keep one clean global Flutter installation on your machine, and use FVM for project-specific versions. That is FVM’s own recommendation.