Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tool_crash] "OS Error: Incorrect function" in plugin symlinking if Flutter and project are on different volumes #66224

Closed
SureshKumar311 opened this issue Sep 20, 2020 · 21 comments · Fixed by #136424
Assignees
Labels
a: build Building flutter applications with the tool c: crash Stack traces logged to the console P1 High-priority issues at the top of the work list platform-windows Building on or for Windows specifically r: fixed Issue is closed as already fixed in a newer version team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team

Comments

@SureshKumar311
Copy link

Command

flutter build windows

Steps to Reproduce

  1. ...
  2. ...
  3. ...

Logs

FileSystemException: Cannot create link, OS Error: Incorrect function.
, errno = 1

#0      _Link.throwIfError (dart:io/link.dart:276:7)
#1      _Link.createSync (dart:io/link.dart:197:5)
#2      ForwardingLink.createSync (package:file/src/forwarding/forwarding_link.dart:22:16)
#3      _createPlatformPluginSymlinks (package:flutter_tools/src/plugins.dart:1113:12)
#4      createPluginSymlinks (package:flutter_tools/src/plugins.dart:1078:5)
#5      buildWindows (package:flutter_tools/src/windows/build_windows.dart:41:3)
#6      BuildWindowsCommand.runCommand (package:flutter_tools/src/commands/build_windows.dart:52:11)
#7      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:985:18)
#8      _rootRunUnary (dart:async/zone.dart:1198:47)
#9      _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#10     _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#11     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#12     Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#13     Future._completeWithValue (dart:async/future_impl.dart:529:5)
#14     Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:567:7)
#15     _rootRun (dart:async/zone.dart:1190:13)
#16     _CustomZone.run (dart:async/zone.dart:1093:19)
#17     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#18     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#19     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#20     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#21     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#22     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
[✓] Flutter (Channel master, 1.22.0-10.0.pre.269, on Microsoft Windows [Version 10.0.18362.116], locale
    en-US)
    • Flutter version 1.22.0-10.0.pre.269 at C:\flutter
    • Framework revision 51fa704642 (23 hours ago), 2020-09-19 11:27:04 -0700
    • Engine revision 4b8477d115
    • Dart version 2.10.0 (build 2.10.0-142.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\sk\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: C:\android-studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.7.30503.244
    • Windows 10 SDK version 10.0.18362.0

[✓] Android Studio (version 4.0)
    • Android Studio at C:\android-studio
    • Flutter plugin version 49.0.2
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[✓] VS Code (version 1.49.1)
    • VS Code at C:\Users\sk\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.14.1

[✓] Connected device (3 available)
    • Windows (desktop) • windows    • windows-x64    • Microsoft Windows [Version 10.0.18362.116]
    • Web Server (web)  • web-server • web-javascript • Flutter Tools
    • Chrome (web)      • chrome     • web-javascript • Google Chrome 85.0.4183.102

• No issues found!

Flutter Application Metadata

Type: null
Version: null
Material: true
Android X: false
Module: false
Plugin: false
Android package: null
iOS bundle identifier: null
Creation channel: master
Creation framework version: eaa9b47

Plugins

path_provider-1.6.16
path_provider_linux-0.0.1+2
path_provider_macos-0.0.4+4
path_provider_windows-0.0.3
shared_preferences-0.5.10
shared_preferences_linux-0.0.2+2
shared_preferences_macos-0.0.1+10
shared_preferences_web-0.1.2+7
url_launcher-5.6.0
url_launcher_linux-0.0.1+1
url_launcher_macos-0.0.1+8
url_launcher_web-0.1.3+2
url_launcher_windows-0.0.1+1
file_chooser
path_provider_fde
menubar
window_size

i was trying to run flutter desktop windows applications i had check flutter doctor but every thinks r correct bu it showing error message as below
PS E:\project_flutter\flutter-desktop-embedding\testbed> flutter build windows

Oops; flutter has exited unexpectedly: "FileSystemException: Cannot create link, path =
'E:\project_flutter\flutter-desktop-embedding\testbed\windows\flutter\ephemeral.plugin_symlinks\path_provider_windows' (OS Error: Incorrect function.
, errno = 1)".

A crash report has been written to E:\project_flutter\flutter-desktop-embedding\testbed\flutter_02.log.
This crash may already be reported. Check GitHub for similar crashes.
https://github.com/flutter/flutter/issues?q=is%3Aissue+FileSystemException%3A+Cannot+create+link%2C+path+%3D+%27E%3A%5Cproject_flutter%5Cflutter-desktop-embedding%5Ctestbed%5Cwindows%5Cflutter%5Cephemeral%5C.plugin_symlinks%5Cpath_provider_windows%27+%28OS+Error%3A+Incorrect+function.%0D%0A%2C+errno+%3D+1%29

plz help me
thank you advance

@stuartmorgan
Copy link
Contributor

E:\

What kind of drive is E? There are limitations on cross-drive symbolic links on Windows, but I'm not clear whether it's all drives, or only non-local drives.

@SureshKumar311
Copy link
Author

it was local E drive in same hard disk in windows and windows is also install in c drive for same disk

@stuartmorgan
Copy link
Contributor

@clarkezone Do you happen to know the exact requirements around symlink support? Is any cross-drive linking forbidden? If so, that'll be an annoying limitation for building projects 😟

@SureshKumar311
Copy link
Author

now i change my flutter project to c drive of my system and run and i got this error

C:\flutter-desktop-embedding\testbed> flutter run
Launching lib\main.dart on Windows in debug mode...
Exception: Building with plugins requires symlink support. Please enable Developer Mode in your system
settings.

FileSystemException: Cannot create link, path =
'C:\flutter-desktop-embedding\testbed\windows\flutter\ephemeral.plugin_symlinks\file_chooser' (OS Error: A
required privilege is not held by the client.
, errno = 1314)

@stuartmorgan
Copy link
Contributor

That second error is expected if you haven't enabled developer mode, thus the error message.

@stuartmorgan stuartmorgan added a: build Building flutter applications with the tool a: desktop Running on desktop platform-windows Building on or for Windows specifically c: crash Stack traces logged to the console labels Sep 20, 2020
@stuartmorgan stuartmorgan changed the title [tool_crash] FileSystemException: Cannot create link, OS Error: Incorrect function., errno = 1 [tool_crash] "OS Error: Incorrect function" in plugin symlinking if Flutter and project are on different volumes Sep 20, 2020
@SureshKumar311

This comment has been minimized.

@stuartmorgan

This comment has been minimized.

@stuartmorgan

This comment has been minimized.

@SureshKumar311

This comment has been minimized.

@clarkezone
Copy link
Contributor

The docs appear to not address this, I can try and find an answer to this.

@nabil6391

This comment has been minimized.

@stuartmorgan

This comment was marked as off-topic.

@stuartmorgan stuartmorgan added the tool Affects the "flutter" command-line tool. See also t: labels. label Sep 28, 2020
@jmagman jmagman added the P2 Important issues not at the top of the work list label Sep 29, 2020
@jmagman jmagman added this to Awaiting triage in Tools - Windows review via automation Sep 29, 2020
@stuartmorgan stuartmorgan removed their assignment Oct 1, 2020
@stuartmorgan
Copy link
Contributor

I was going to fix this while fixing #66973 but I don't actually have a setup with a network volume. @jonahwilliams since you hit this you presumably do; could you take this one?

@jonahwilliams
Copy link
Member

I do not, I was scrubbing through crash logs and I found it :(

@H-MAli
Copy link

H-MAli commented Aug 15, 2023

The reproduction of this problem is actually easier than that. At least it's what I'm experiencing.

  • Have flutter installed on some NTFS volume.
  • Create a project on an exFAT volume.
  • Try to build your project, et voila! You're presented with this error.

I'm not quite sure whether using any specific Flutter package triggers symlinking or not since I encountered this error when moving an existing project to an exFAT volume with lots of packages already in use.

auto-submit bot pushed a commit that referenced this issue Oct 12, 2023
christopherfujino added a commit to christopherfujino/flutter that referenced this issue Oct 16, 2023
@darshankawar darshankawar added the r: fixed Issue is closed as already fixed in a newer version label Oct 17, 2023
auto-submit bot pushed a commit that referenced this issue Oct 17, 2023
@lefour0403
Copy link

@SureshKumar311 do not need to change the location of your project. With Windows App, run your project in Release Mode or close your IDE and rerun as Administrator. That fixed for me!

Copy link

github-actions bot commented Nov 1, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: build Building flutter applications with the tool c: crash Stack traces logged to the console P1 High-priority issues at the top of the work list platform-windows Building on or for Windows specifically r: fixed Issue is closed as already fixed in a newer version team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team
Projects
Tools - Windows review
  
Engineer reviewed
Status: Better Windows DevX