Reputation: 13
Help please.
I'm currently having issued creating a windows build for my flutter projects - which are basically projects from YT tutorials. It was working just last week, but now every time I build for Windows, I get this error:
"Creating symlink from source to dest failed with ERROR_INVALID_FUNCTION. Try moving your Flutter project to the same drive as your Flutter SDK."
I've been playing around with Flutter on and off over the course of the past one and a half years, and having the Flutter project source on a separate drive from my Flutter SDK installation has never been an issue up to about earlier this week, when I get that error on a Windows build.
This is the result of the flutter build windows -v command:
*Note: this part has white text on the actual screen
[ +161 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ +10 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[ +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +48 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[ ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[ ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[ +3 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ +3 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[ +56 ms] Skipping pub get: version match.
[ +37 ms] Found plugin file_selector_linux at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\file_selector_linux-0.9.2+1\
[ +8 ms] Found plugin file_selector_macos at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\file_selector_macos-0.9.3+3\
[ +6 ms] Found plugin file_selector_windows at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\file_selector_windows-0.9.3+1\
[ +5 ms] Found plugin flutter_plugin_android_lifecycle at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_plugin_android_lifecycle-2.0.17\
[ +7 ms] Found plugin image_picker at C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker-1.0.5\
[ +3 ms] Found plugin image_picker_android at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_android-0.8.9+1\
[ +2 ms] Found plugin image_picker_for_web at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_for_web-3.0.1\
[ +3 ms] Found plugin image_picker_ios at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_ios-0.8.9\
[ +3 ms] Found plugin image_picker_linux at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_linux-0.2.1+1\
[ +2 ms] Found plugin image_picker_macos at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_macos-0.2.1+1\
[ +4 ms] Found plugin image_picker_windows at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_windows-0.2.1+1\
[ +282 ms] Found plugin file_selector_linux at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\file_selector_linux-0.9.2+1\
[ +2 ms] Found plugin file_selector_macos at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\file_selector_macos-0.9.3+3\
[ +3 ms] Found plugin file_selector_windows at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\file_selector_windows-0.9.3+1\
[ +2 ms] Found plugin flutter_plugin_android_lifecycle at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_plugin_android_lifecycle-2.0.17\
[ +5 ms] Found plugin image_picker at C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker-1.0.5\
[ +2 ms] Found plugin image_picker_android at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_android-0.8.9+1\
[ +1 ms] Found plugin image_picker_for_web at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_for_web-3.0.1\
[ +1 ms] Found plugin image_picker_ios at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_ios-0.8.9\
[ +2 ms] Found plugin image_picker_linux at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_linux-0.2.1+1\
[ +1 ms] Found plugin image_picker_macos at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_macos-0.2.1+1\
[ +2 ms] Found plugin image_picker_windows at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_windows-0.2.1+1\
[ +49 ms] Found plugin file_selector_linux at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\file_selector_linux-0.9.2+1\
[ +1 ms] Found plugin file_selector_macos at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\file_selector_macos-0.9.3+3\
[ +2 ms] Found plugin file_selector_windows at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\file_selector_windows-0.9.3+1\
[ +2 ms] Found plugin flutter_plugin_android_lifecycle at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_plugin_android_lifecycle-2.0.17\
[ +3 ms] Found plugin image_picker at C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker-1.0.5\
[ +1 ms] Found plugin image_picker_android at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_android-0.8.9+1\
[ +1 ms] Found plugin image_picker_for_web at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_for_web-3.0.1\
[ +1 ms] Found plugin image_picker_ios at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_ios-0.8.9\
[ +1 ms] Found plugin image_picker_linux at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_linux-0.2.1+1\
[ +1 ms] Found plugin image_picker_macos at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_macos-0.2.1+1\
[ +3 ms] Found plugin image_picker_windows at
C:\Users\IDEAPAD\AppData\Local\Pub\Cache\hosted\pub.dev\image_picker_windows-0.2.1+1\
[ +96 ms] Generating
F:\projects\programming\flutter\playground\flutter_dynamic_form\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[ +123 ms] "flutter windows" took 831ms.
* And this is where the text changes to red
[ +4 ms] Creating symlink from source to dest failed with ERROR_INVALID_FUNCTION. Try moving your Flutter project to the same drive as your Flutter SDK.
[ +2 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 handleSymlinkException (package:flutter_tools/src/flutter_plugins.dart:1040:7)
#2 _createPlatformPluginSymlinks (package:flutter_tools/src/flutter_plugins.dart:1071:7)
#3 createPluginSymlinks (package:flutter_tools/src/flutter_plugins.dart:991:5)
#4 buildWindows (package:flutter_tools/src/windows/build_windows.dart:76:3)
#5 BuildWindowsCommand.runCommand (package:flutter_tools/src/commands/build_windows.dart:56:11)
<asynchronous suspension>
#6 FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1350:27)
<asynchronous suspension>
#7 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#8 CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#9 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:348:9)
<asynchronous suspension>
#10 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#11 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:294:5)
<asynchronous suspension>
#12 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:112:9)
<asynchronous suspension>
#13 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#14 main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>
* And this is where the text returns to white
[ +258 ms] ensureAnalyticsSent: 252ms
[ ] Running 0 shutdown hooks
[ ] Shutdown hooks complete
[ ] exiting with code 1
I'm running Flutter on laptop with the following:
OS - Windows 11 OS Build - 22621.2861 Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.8.3
And here are my flutter doctor -v results:
[✓] Flutter (Channel stable, 3.16.5, on Microsoft Windows [Version 10.0.22621.2861], locale en-PH)
• Flutter version 3.16.5 on channel stable at G:\AppDev\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 78666c8dc5 (2 weeks ago), 2023-12-19 16:14:14 -0800
• Engine revision 3f3e560236
• Dart version 3.2.3
• DevTools version 2.28.4
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at g:\appdev\android\androidsdk
• Platform android-33, build-tools 33.0.0
• ANDROID_HOME = G:\AppDev\Android\AndroidSDK
• Java binary at: G:\AppDev\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.3)
• Visual Studio at G:\AppDev\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.8.34330.188
• Windows 10 SDK version 10.0.22000.0
[✓] Android Studio (version 2022.2)
• Android Studio at G:\AppDev\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 17.0.6+0-b2043.56-9586694)
[✓] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22621.2861]
• Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.130
• Edge (web) • edge • web-javascript • Microsoft Edge 120.0.2210.91
[✓] Network resources
• All expected network resources are available.
• No issues found!
I've been searching the web for any solution or any hint for the past 8 hours (more or less) now, and it's driving me nuts.
I've tried doing flutter clean, flutter pub cache repair, deleting the project windows folder and running flutter create ., but nothing is working.
Unfortunately, re-installing flutter is not a viable option at the moment.
Thanks for your help.
Upvotes: 0
Views: 1410
Reputation: 35
This may be due to restricted permissions, different drives, or file system issues, particularly with FAT32 drives.Try to activate developer mode on terminal run
start ms-settings:developers
then allow developer mode
then try again creating a windows build. If fails try to change drive to NTFS format.
Upvotes: 0
Reputation: 111
I had the same problem today. The disk was of the exFAT type. I tried various options, but nothing helped. Formatted it to NTFS format and the error changed to:
Building with plugins requires symlink support. Please enable Developer Mode in your system settings. Run start ms-settings:developers to open settings.
After that, in Windows, I went to Settings->Update & Security->For Developers and turned on Developer Mode. After that, everything worked.
P.S. For those who encounter this. Try to enable developer mode before formatting and write back whether it helped or not. It will be useful for those who face the same problem in the future.
Upvotes: 1
Reputation: 23
I had the same problem too, I'm running Flutter 3.16.5 on Windows 10. Upgrading Flutter to 3.16.7 DIDN'T WORK. but somehow Converting the partition (where Flutter SDK & My Flutter Project lives) from FAT32 to NTFS, Worked !
Upvotes: 1