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

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.

0
Subscribe to my newsletter

Read articles from Chinenye Anikwenze directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Chinenye Anikwenze
Chinenye Anikwenze

I create stunning user-friendly web apps that engage and ease user experience on the client side and that's because I love the intersection of solving problems for the customers, while making their User Experience seamless. I also write articles on technologies I've used, tutorials, bugs I've encountered in my codes and how I was able to resolve them.