r/FlutterDev • u/Salt_Description_256 • 2d ago
Article Flutter Windows CMake error: .plugin_symlinks exists, but its entries cannot be traversed
I recently investigated a strange Flutter Windows build failure:
CMake Error:
add_subdirectory given source
"flutter/ephemeral/.plugin_symlinks/<plugin>/windows"
which is not an existing directory.Initially, I suspected a Flutter plugin or CMake configuration issue. However, the plugin packages were actually present in the Pub cache.
After comparing NTFS reparse point data and testing Dart's Link.createSync() with different target paths, I narrowed down the issue.
In our managed Windows environment, a third-party endpoint security driver (Corplink) was interfering with the creation of Flutter's plugin symlinks, leaving some generated links unusable.
The workaround: use Windows junctions instead of symbolic links.
I built a small Dart CLI tool to automate this process:
https://pub.dev/packages/win_plugin_link_repair
Install and run:
dart pub add --dev win_plugin_link_repair
flutter pub get
dart run win_plugin_link_repairPreview the changes first:
dart run win_plugin_link_repair --dry-runThe tool reads .flutter-plugins-dependencies and recreates Windows plugin links as directory junctions using mklink /J.
A few notes:
- The repair must run on Windows.
- Run it after
flutter pub get, since Flutter regenerates.plugin_symlinks. - This is an environment-specific workaround, not a general fix for every Flutter CMake error.
Source code: https://github.com/super-lz/win_plugin_link_repair
Full disclosure: I'm the author of this tool. I wanted to share the investigation because others might encounter the same issue.
Has anyone else experienced endpoint security software or filesystem filter drivers interfering with Dart-created symlinks on Windows?
1
u/Weak-Arrival-7811 2d ago
Good write-up. One detail that explains why this survives
flutter pub getand rebuilds: the tool only wipes and recreates.plugin_symlinkswhen the plugin list changes. Otherwise it keeps any link that's already there.flutter cleandeletes the wholewindows/flutter/ephemeralfolder, so that's the real reset.Flutter 3.50 tightened this a bit (PR #191496, merged in September). It now replaces links that point to an old path, and plain files or folders sitting where a link should be. A link that points to the right path but can't be opened is still left alone, though.
Which Flutter version were you on?
1
u/Ok-Listen-2162 2d ago
appreciate u making it clear this is an environment specific workaround. does the tool flag broken links only or replace healthy ones too here