Skip to main content

Command Palette

Search for a command to run...

Fixing Flutter Errors on Windows: When flutter doctor Can’t Find Java, Git, or dartaotruntime.exe

Published
3 min read
Fixing Flutter Errors on Windows: When flutter doctor Can’t Find Java, Git, or dartaotruntime.exe
C

I create stunning user-friendly web apps that engage and simplify the user experience on the client side. I love the intersection of solving customer problems while making their journey seamless. My current focus is building modular AI architectures using n8n, which allows me to deploy private, high-speed automation on self-hosted VPS environments.

I am also a technical writer. I share my journey through articles on new technologies, tutorials, and walkthrough into the bugs I encounter. My goal is to explain how I resolved those issues to help other developers build better, faster code

If you’re running into weird issues when setting up Flutter on Windows, like:

  • Unable to find bundled Java version

  • Git not found

  • dartaotruntime.exe missing

  • Flutter crashing without warning

You’re not alone. I hit all of these back-to-back, and it turned out to be a mix of missing installations and Avira Antivirus silently deleting my files.

Let me walk you through what happened and how I fixed everything — step by step.


The Very First Problem: Git and Java Weren’t Detected

I was still working on a flutter project when all of a sudden, my git status was no longer showing. So when I ran

git init

I got this:

Git not found

Then I ran:

flutter doctor

I got this:


[✗] Unable to find bundled Java version

Even though I had both installed earlier, something was off.

Step 1: Reinstall Git and Java

Just to be sure, I reinstalled both from their official sources:

Make sure you install the JDK, not just the JRE, and that it's a stable version

Also: After installing, confirm both git and java are in your system PATH. Run git --version and java -version in your terminal to verify.


Then Came the Flutter Doctor Warnings

After fixing Git and Java, I expected flutter doctor to be clean. But nope. I saw:

[!] Android Studio (version 2024.2)
    X Unable to find bundled Java version.

It was Android Studio now causing the complaint — not Flutter directly.

Step 2: Reinstall Android Studio

Here’s what worked: Reinstall Android Studio completely.

This ensures it restores the missing JetBrains Runtime (jbr) and Java binaries that Flutter needs.

In my case, Avira had removed parts of the JetBrains Runtime. More on that below.


Final Blow: Flutter Crashed with Missing dartaotruntime.exe

At this point, I thought I was done... until Flutter suddenly refused to run and showed this:

Oops; flutter has exited unexpectedly: 
"ProcessException: Failed to find "C:\dev\flutter\bin\cache\dart-sdk\bin\dartaotruntime.exe"

That Dart runtime file was just gone. Deleted.

The Culprit? Avira Antivirus

Avira was silently uninstalling files like:

  • java.exe

  • dartaotruntime.exe

  • other .exe files in the Flutter toolchain


How to Stop Avira from Breaking Your Flutter Setup

Step 3: Add Dev Tools to Avira’s Exception List

To stop this from happening again, whitelist your dev tools:

Steps:

  1. Open Avira Security

  2. Go to Settings → Security → Protection Options → Real-time protection

  3. Add these folders to your excluded folders

     C:\dev\flutter
     C:\Program Files\Java
     C:\Program Files\Android\Android Studio
     C:\Users\<YourUser>\AppData\Local\Android
    
  4. Also add individual .exe files if needed:

     dartaotruntime.exe
     java.exe
     flutter.bat
    


Step 4: Rebuild Flutter Cache (If Files Were Deleted)

If any Dart or Flutter files were removed by Avira:

flutter clean
flutter pub get

Then manually delete:

C:\dev\flutter\bin\cache

And let Flutter rebuild everything:

flutter doctor

A quick Summary

ProblemSolution
Git not foundReinstall Git and verify it’s in PATH
Java missing in FlutterReinstall JDK (Java Development Kit)
Java missing in Android StudioReinstall Android Studio
Flutter crashes – dartaotruntime.exe missingWhitelist tools in Avira and rebuild cache
Files silently disappearingAdd dev tools to Avira exceptions list

So, Flutter itself isn’t always the problem , sometimes your antivirus is the one making life hard. A few reinstalls plus the right Avira exceptions, and you’re back in business.