【问题标题】:flutter fvm error when using `use` command to change flutter version使用`use`命令更改flutter版本时出现flutter fvm错误
【发布时间】:2021-09-03 08:17:20
【问题描述】:

我正在尝试使用 Flutter fvm 版本管理,但是当我尝试使用新版本时出现此错误。该配置会自动创建吗?以及如何开启权限?

D:\dev_projects\myapp>fvm list
Cache Directory:  C:\Users\user\fvm\versions

2.2.3
1.22.5 (active)

D:\dev_projects\myapp>fvm use 2.2.3 --verbose
[     0.073s] FileSystemException: Cannot open file, path = 'C:\Users\user\fvm\.settings' (OS Error: The system cannot find the file specified., errno = 2)
[     0.082s] FileSystemException: Cannot open file, path = 'C:\Users\user\fvm\.settings' (OS Error: The system cannot find the file specified., errno = 2)
[     0.082s] FileSystemException: Cannot open file, path = 'C:\Users\user\fvm\.settings' (OS Error: The system cannot find the file specified., errno = 2)
[     0.084s] Version: 2.2.3 - already installed.
[     0.090s] FileSystemException: Cannot open file, path = 'C:\Users\user\fvm\.settings' (OS Error: The system cannot find the file specified., errno = 2)
[     0.097s] FileSystemException: Cannot create link to target 'C:\Users\user\fvm\versions\1.22.5', path = 'D:\dev_projects\myapp\.fvm\flutter_sdk' (OS Error: A required privilege is not held by the client.
, errno = 1314)
[     0.098s] Usage Exception: Seems you don't have the required permissions on C:\Users\user\fvm On Windows FVM requires to run as an administrator or turn on developer mode: 

更新:

D:\dev_projects\myapp>fvm doctor
    
    FVM Version: 2.2.3
    ___________________________________________________
    
    FVM config found:
    ___________________________________________________
    
    Project: myapp
    Directory: D:\dev_projects\myapp
    Version: 1.22.5
    Project Flavor: None selected
    ___________________________________________________
    
    Version is currently cached locally.
    
    Cache Path: C:\Users\user\fvm\versions\1.22.5
    Channel: false
    SDK Version: 1.22.5
    
    IDE Links
    VSCode: .fvm/flutter_sdk
    Android Studio: D:\dev_projects\myapp\.fvm\flutter_sdk
    
    
    Configured env paths:
    ___________________________________________________
    
    Flutter:
    D:\dev\flutter\bin\flutter.bat
    
    Dart:
    D:\dev\flutter\bin\dart.bat
    
    FVM_HOME:
    not set

【问题讨论】:

  • 只需使用fvm use 2.2.3
  • fvm use 旨在用于 Flutter 项目中。看起来您正在 fvm 安装文件夹中使用它。如果您想在全局范围内使用 Flutter 版本并从任何可以使用 fvm global 2.2.3 的地方调用它
  • @Martyns 它仍然有同样的错误。从 fvm 安装文件夹中使用它是什么意思?顺便说一句,我在 myapp flutter 项目中使用 vscode 终端。我更新了包括 fvm 医生在内的问题。
  • @unice 对不起,你是对的。我误读了日志

标签: flutter dart


【解决方案1】:

对我来说,这是因为我复制了一个颤振项目文件夹。我删除了 .fvm 文件夹并使用了 fvm 并且它起作用了

【讨论】:

    【解决方案2】:

    我按照日志的建议通过打开开发者模式解决了这个问题。转到您的设置,搜索开发人员设置并从那里启用它。现在重新启动 IDE 并重试。

    【讨论】:

      【解决方案3】:

      我不知道这是否正确,但我通过以管理员身份运行 vscode 解决了它。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-08-18
        • 2021-08-25
        • 2021-01-25
        • 2021-06-04
        • 2021-11-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多