gpt4 book ai didi

installation - flutter doctor 在 "Updating flutter tool..."后挂起

转载 作者:IT王子 更新时间:2023-10-29 06:37:46 24 4
gpt4 key购买 nike

首先:我用谷歌搜索“flutter doctor”并搜索了你的网站也是如此。我将在下面详细说明我的结果,但在此之前我在这里:

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 但是当我运行 “flutter doctor”命令它刚刚挂起。

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

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

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

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 进行了一些开发,但对控件的支持有限,我希望这个工具会更有效率。如果有人可以帮助我解决这个问题,我将不胜感激。谢谢,霸王龙

以下新信息:

我尝试在具有管理员权限的命令窗口中运行 flutter doctor 命令,结果相同。然后它尝试使用一些 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

================== 命令窗口中的结果结束 =====================

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

为了澄清上面的编辑,我完全删除了与 flutter 相关的所有内容,然后将其重新安装/解压缩到另一个目录“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 ===========

我决定再次尝试 beta 的克隆,因为这是我之前所做的所有事情中最有希望的。完成后,我使用 power shell 并发出“flutter channel”命令只是为了看看它会做什么。令人惊讶的是,我得到了与之前运行“flutter doctor”类似的结果。首先在屏幕顶部有一个输出显示正在下载 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

此时我几乎不知所措。

最佳答案

尝试过以下方法吗?

使用管理员权限从命令提示符运行 flutter doctor 命令?

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

顺便说一句,我正在看这个问题,它看起来与您所描述的相似:https://github.com/flutter/flutter/issues/11698

关于installation - flutter doctor 在 "Updating flutter tool..."后挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50260094/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com