Skip to content

[Windows] Debug build fails with LNK1104: cannot open flutter_secure_storage_windows_plugin.dll (Release works fine) #981

@annd22

Description

@annd22

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

  1. flutter create test_secure_storage
  2. Add flutter_secure_storage to pubspec.yaml
  3. Run flutter run -d windows --debug
    → ❌ fails with LNK1104
  4. 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions