[Windows] Debug build fails with LNK1104: cannot open flutter_secure_storage_windows_plugin.dll (Release works fine)
Hi maintainers π
When adding flutter_secure_storage to a Flutter project targeting Windows, the plugin builds and runs successfully in Release mode, but fails in Debug mode with the following error:
LINK : fatal error LNK1104: cannot open file '...\flutter_secure_storage_windows_plugin.dll'
- In Release, the .dll is generated under
build\windows\x64\plugins\flutter_secure_storage_windows\Release\. - In Debug, the linker fails and the .dll is never produced.
Repro steps
flutter create test_secure_storage- Add
flutter_secure_storagetopubspec.yaml - Run flutter
run -d windows --debugβ β fails with LNK1104 - Run
flutter run -d windows --releaseβ β succeeds and DLL is generated
Environment
- Flutter:
[β] Flutter (Channel stable, 3.29.3, on Microsoft Windows [Version 10.0.26100.5074], locale en-US) [479ms]
β’ Flutter version 3.29.3 on channel stable at C:\Users\annd\fvm\versions\3.29.3
β’ Upstream repository https://github.com/flutter/flutter.git
β’ Framework revision ea121f8859 (5 months ago), 2025-04-11 19:10:07 +0000
β’ Engine revision cf56914b32
β’ Dart version 3.7.2
β’ DevTools version 2.42.3
[β] Windows Version (Windows 11 or higher, 24H2, 2009) [1,316ms]
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [3.4s]
β’ Android SDK at C:\Users\annd\AppData\Local\Android\sdk
β’ Platform android-35, build-tools 35.0.0
β’ Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
β’ Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe) [108ms]
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[β] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.13 (August 2025)) [106ms]
β’ Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
β’ Visual Studio Community 2022 version 17.14.36414.22
β’ Windows 10 SDK version 10.0.26100.0
[β] Android Studio (version 2024.2) [18ms]
β’ Android Studio at C:\Program Files\Android\Android Studio
β’ Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
β’ Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
β’ Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
[β] VS Code (version 1.100.2) [17ms]
β’ VS Code at C:\Users\annd\AppData\Local\Programs\Microsoft VS Code
β’ Flutter extension version 3.112.0
[β] Connected device (3 available) [611ms]
β’ 2107113SG (mobile) β’ 278025b4 β’ android-arm64 β’ Android 14 (API 34)
β’ Windows (desktop) β’ windows β’ windows-x64 β’ Microsoft Windows [Version 10.0.26100.5074]
β’ Edge (web) β’ edge β’ web-javascript β’ Microsoft Edge 139.0.3405.125
[β] Network resources [1,128ms]
β’ All expected network resources are available.
! Doctor found issues in 2 categories.
- flutter_secure_storage:
^9.2.4 - Windows 11 Pro / Visual Studio 2022 Community
- Target: Windows Desktop (x64)
Log details when running with --verbose:
Touching "flutter_secure_storage_windows_plugin.dir\Debug\flutter_.D533E7BB.tlog\unsuccessfulbuild".
[ +3 ms] CustomBuild:
[ ] All outputs are up-to-date.
[ +8 ms] ClCompile:
[ ] All outputs are up-to-date.
[ +13 ms] Link:
[ ] C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE
/OUT:"C:\Code\H\workspace_mobile_1\apps\workspace\build\windows\x64\plugins\flutter_secure_storage_windows\Debug\flutter_secure_storage_windows_plugin.dll" /INCREMENTAL
/ILK:"flutter_secure_storage_windows_plugin.dir\Debug\flutter_secure_storage_windows_plugin.ilk" /NOLOGO ..\..\flutter\Debug\flutter_wrapper_plugin.lib C:\Code\H\workspace_mobile_1\apps\workspace\windows\flutter\ephemeral\flutter_windows.dll.lib
kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG
/PDB:"C:/Code/H/workspace_mobile_1/apps/workspace/build/windows/x64/plugins/flutter_secure_storage_windows/Debug/flutter_secure_storage_windows_plugin.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT
/IMPLIB:"C:/Code/H/workspace_mobile_1/apps/workspace/build/windows/x64/plugins/flutter_secure_storage_windows/Debug/flutter_secure_storage_windows_plugin.lib" /MACHINE:X64 /machine:x64 /DLL
flutter_secure_storage_windows_plugin.dir\Debug\flutter_secure_storage_windows_plugin.obj
[ +147 ms] Creating library C:/Code/H/workspace_mobile_1/apps/workspace/build/windows/x64/plugins/flutter_secure_storage_windows/Debug/flutter_secure_storage_windows_plugin.lib and object
C:/Code/H/workspace_mobile_1/apps/workspace/build/windows/x64/plugins/flutter_secure_storage_windows/Debug/flutter_secure_storage_windows_plugin.exp
[ +315 ms] LINK : fatal error LNK1104: cannot open file 'C:\Code\H\workspace_mobile_1\apps\workspace\build\windows\x64\plugins\flutter_secure_storage_windows\Debug\flutter_secure_storage_windows_plugin.dll'
[C:\Code\H\workspace_mobile_1\apps\workspace\build\windows\x64\plugins\flutter_secure_storage_windows\flutter_secure_storage_windows_plugin.vcxproj]
[ +42 ms] Done Building Project "C:\Code\H\workspace_mobile_1\apps\workspace\build\windows\x64\plugins\flutter_secure_storage_windows\flutter_secure_storage_windows_plugin.vcxproj" (default targets) -- FAILED.
[ +23 ms] Project "C:\Code\H\workspace_mobile_1\apps\workspace\build\windows\x64\runner\b3works.vcxproj" (6) is building "C:\Code\H\workspace_mobile_1\apps\workspace\build\windows\x64\flutter\flutter_wrapper_app.vcxproj" (17) on node 1
(default targets).
Maybe this update helps.
Thanks for the quick response π
I noticed the attachment is a zipped .exe file. For security reasons I canβt run unknown executables.
Could you please share the fix in source form (a commit, PR, or patch)? Also, could you explain the root cause of the issue (why the plugin builds fine in Release but fails in Debug with LNK1104)?
@annd22 We encountered the same issue. The root cause appears to be that the antivirus detected flutter_secure_storage_windows_plugin.dll as an infected file, identifying it as "Gen:Variant.Tedy.816373".
This only happens in debug mode and does not occur in release mode.
@annd22 We encountered the same issue. The root cause appears to be that the antivirus detected
flutter_secure_storage_windows_plugin.dllas an infected file, identifying it as "Gen:Variant.Tedy.816373". This only happens in debug mode and does not occur in release mode.![]()
Thanks for the reply. I confirm that this is a problem caused by the antivirus (Bitdefender).
Hi maintainers,
Iβve confirmed that the failure in Debug mode is caused by Bitdefender deleting flutter_secure_storage_windows_plugin.dll during build. Bitdefender detects it as Gen:Variant.Tedy.816373 (false positive), but this only happens for Debug builds β Release builds are unaffected.
Iβd like to understand whether there is anything in the way the Windows plugin DLL is built (e.g., debug symbols, compilation flags, etc.) that could be triggering this detection. Knowing the exact cause would help me (and others) report a more accurate false-positive case to Bitdefender, and ensure it isnβt something in the plugin itself.
Iβm not asking you to βfix antivirus software,β but rather to confirm whether the build output is expected and whether you see this as a bug (or at least something worth documenting for Windows users).
Thanks for your help!
β οΈ This issue has been marked as stale because it has been open for 60 days with no activity.
If this issue is still relevant, please comment to keep it active. Otherwise, it will be closed in 60 days.