【问题标题】:flutter doctor hangs after "Updating flutter tool..."“更新颤振工具...”后颤振医生挂起
【发布时间】:2018-05-09 18:41:07
【问题描述】:

首先:我用谷歌搜索了“颤振医生”并搜索了您的 网站也是如此。我将在下面详细说明我的结果,但在此之前是我所在的位置:

1) 我按照https://flutter.io/setup-windows/ 的指示进行操作,直到无法继续。

2) 我的环境是: Windows 10、64 位、210 Gb 可用空间 Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz; 8.00 GB 安装内存(RAM)

    I have PowerShell 5.1, 
    I have setup Git for Windows with "Use Git from 
        the Windows Command Prompt" option
    I am able to run git from the command prompt or power shell

3) 我尝试下载测试版的 .zip,但是当我运行 “颤动医生”命令它刚刚挂起。

4) 现在是搜索结果: 我发现了 3 个相关问题:

a) “让 Flutter 医生开始工作” - 我尝试克隆“alpha”版本 并检查“后台智能传输服务正在运行”(它 是)。

b) “运行 Flutter Doctor 没有任何结果” - 我删除了 alpha 版本 并使用 git bash 克隆了 beta 版本,结果如​​下:

rex@NEXIUM MINGW64 /c/flutter
$  git clone -b beta https://github.com/flutter/flutter.git
Cloning into 'flutter'...
remote: Counting objects: 122267, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 122267 (delta 0), reused 0 (delta 0), pack-reused 122262
Receiving objects: 100% (122267/122267), 37.56 MiB | 2.39 MiB/s, done.
Resolving deltas: 100% (91730/91730), done.
Checking out files: 100% (2473/2473), done.

This also did not work (i.e. flutter doctor still hangs)

c) “Flutter doctor 没有在命令提示符下运行”——这个是最多的 有希望的结果:

   I deleted the cache folder under the ..\AppData\Roaming\Pub directory.
   when I ran "flutter doctor" this time I got the following results:

C:\Users\rex>flutter doctor
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 09d05a38912a3c1a906e95099cac9a7e14fae85f...
Unzipping Dart SDK...
    // here there was some text above the  ========== in the console about bits...
    // which went away, window appeared compressed and then the following message:
Updating flutter tool...
// HANGS HERE

我希望安装 Flutter 工具并尝试使用它来开发 Android 和/或 iOS 应用程序。我在 Visual Studio 2017 中使用 Xamarin 进行了一些开发,但对控件的支持有限,我是 希望这个工具会更有效率。如果有人可以帮助我解决这个问题,我将不胜感激。谢谢, 雷克斯

以下新信息:

我尝试在具有管理员权限的命令窗口中运行颤振医生命令,结果相同。然后它尝试使用一些 echo 命令编辑 flutter.bat 文件,以尝试获取其他信息,这些信息表明批处理文件正在执行以下语句:

>CALL "%dart%" %FLUTTER_TOOL_ARGS% "%snapshot_path%" %*

我编辑了批处理文件以取消注释分配给我附加信息的 FLUTTER_TOOL_ARGS 的行,批处理文件退出如下:
================== 命令窗口中的结果=====================

>C:\Windows\System32>flutter doctor  
>in acquire_lock ...    # ECHO to get debug information  
>in subroutine ...      # ECHO to get debug information  
>in after_subroutine ...# ECHO to get debug information    
>dart - C:\src\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe # ECHO dart  
>FLUTTER_TOOL_ARGS ""--checked " --observe=65432" # ECHO FLUTTER_TOOL_ARGS    
 #next line is ECHO of snapshot_path  
>snapshot_path C:\src\flutter\flutter\bin\cache\flutter_tools.snapshot  

============== the following was output from the batch file =========  

 Unhandled exception:
 Could not load "file:///C:/Windows/System32/%20--observe=65432":   
 FileSystemException: Cannot open file, path =  
 'C:\Windows\System32\ -->observe=65432'  
 (OS Error: The system cannot find the file specified. , errno = >2) null  
 # another ECHO    
 after CALL ... # echo to get debug information 

====================================================================================== /p>

=========== 另一个新编辑 =============

为了澄清上述编辑,我完全删除了与颤振相关的所有内容,然后将其重新安装/解压缩到另一个不需要管理员权限编辑等的目录“C:\src\flutter”中,但我做到了不要像以前那样删除 ..\AppData\Roaming\Pub 目录下的缓存文件夹,所以我今天早上要回去做。我还将在命令提示符下使用 -v 或 -verbose 选项来查看是否有任何其他帮助,并在完成后添加新信息。

============== 后续编辑 =================

我去掉了一些debug ECHO语句,修改了一些,确保7z.exe在路径中,去掉了缓存目录但结果基本一致如下:

C:\WINDOWS\system32>flutter doctor -verbose  
Show dart, FLUTTER_TOOL_ARGS, and snapshot_path:  
dart - C:\src\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe  
FLUTTER_TOOL_ARGS ""--checked " --observe=65432"  
snapshot_path C:\src\flutter\flutter\bin\cache\flutter_tools.snapshot  
execute call to dart ...  
Unhandled exception:  
Could not load "file:///C:/Windows/System32/%20--observe=65432":   
    FileSystemException: Cannot open file, path =   
    'C:\Windows\System32\ --observe=65432' (OS Error: The system cannot find   
    the file specified., errno = 2)  
    null
returned from call to dart
exit code 255

C:\Windows\System32>  

============ Another Update  ===========  

我决定再次尝试克隆测试版,因为这是我之前所做的所有事情中最有希望的。完成后,我使用了 power shell 并发出了“flutter channel”命令,看看它会做什么。令人惊讶的是,我得到了与之前运行“颤振医生”类似的结果。首先,屏幕顶部有一个输出显示 dart 正在下载,然后在完成后,控制台上会在原始命令下方打印以下内容:

C:\Users\rex>flutter channel  
Checking Dart SDK version...  
Downloading Dart SDK from Flutter engine   
    1ed25ca7b7e3e3e8047df050bba4174074c9b336...  
Unzipping Dart SDK...  
Updating flutter tool...  

然后控制台像以前一样挂起......

我终于中止了命令并在 flutter.bat 中设置了 echo on。该文件挂起,屏幕上显示以下命令(都在同一行):

C:\src\flutter>CALL "C:\src\flutter\bin\cache\dart-sdk\bin\dart.exe"  
    "--checked --observe=65432" 
    "C:\src\flutter\bin\cache\flutter_tools.snapshot" doctor  

在这一点上,我几乎不知所措。

【问题讨论】:

    标签: installation flutter


    【解决方案1】:

    尝试过以下方法吗?

    从具有管理员权限的命令提示符运行颤振医生命令?

    尝试安装不同类型的解压缩程序(如 7-zip)并确保它在 PATH 中?

    顺便说一句,我正在研究的问题似乎与您所描述的相似:https://github.com/flutter/flutter/issues/11698

    【讨论】:

    • 我已经按照我从参考资料中的理解完成了所有工作,但没有任何帮助。我已经编辑了原始信息并添加了修改批处理文件的结果,以便能够查看正在发生的事情。调用执行“dart”时返回错误。似乎在 windows\system32\ 目录中有一个不存在的文件的引用,但打印结果对我来说没有多大意义。
    【解决方案2】:

    您可以尝试使用具有管理员访问权限的 Flutter 控制台,并尝试将更改频道更改为当前稳定版本flutter channel stable

    然后,再次运行flutter upgrade。

    希望对你有所帮助。

    【讨论】:

      【解决方案3】:

      您似乎没有足够的权限来保存或编辑该目录中的文件。 尝试以管理员身份运行命令提示符或尝试以管理员身份运行颤振控制台并检查是否有帮助。

      【讨论】:

        【解决方案4】:

        可能是防病毒或防火墙阻止 尝试在安全模式下运行 windows,然后运行颤振命令

        【讨论】:

          【解决方案5】:

          在 Windows 上,最简单的方法是下载最新版本的 Flutter SDK。通过粘贴下载的flutter文件夹而不是C盘中的当前文件夹来手动替换当前文件夹。始终选择“替换并粘贴”。

          【讨论】:

            猜你喜欢
            • 2019-06-09
            • 2020-03-11
            • 2021-08-08
            • 1970-01-01
            • 2022-12-20
            • 1970-01-01
            • 2019-07-03
            • 2021-09-16
            相关资源
            最近更新 更多