2

Microsoft Windows [Version 6.3.9600] 
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Users\DELL>flutter doctor -v 
Checking Dart SDK version... 
Downloading Dart SDK from Flutter engine 6bc433c6b6b5b98dcf4cc11aff31cdee90849f3
    2...

这就是控制台卡住的地方。当 VS 代码提示我升级颤振扩展时,问题就开始了。我觉得它花费了太多时间(可能是由于网络错误)所以我取消了它。现在我的 Android Studio Emulator 无法连接到 VS 代码。

[11:12:25 AM] [General] [Info] Searching for SDKs...
[11:12:25 AM] [General] [Info] Environment PATH:
[11:12:25 AM] [General] [Info]     C:\Windows\system32
[11:12:25 AM] [General] [Info]     C:\Windows
[11:12:25 AM] [General] [Info]     C:\Windows\System32\Wbem
[11:12:25 AM] [General] [Info]     C:\Windows\System32\WindowsPowerShell\v1.0\
[11:12:25 AM] [General] [Info]     C:\Program Files (x86)\Skype\Phone\
[11:12:25 AM] [General] [Info]     C:\Program Files\Git\cmd
[11:12:25 AM] [General] [Info]     C:\Program Files\nodejs\
[11:12:25 AM] [General] [Info]     C:\Users\DELL\flutter_windows_1.17.0-stable\flutter\bin
[11:12:25 AM] [General] [Info]     E:\Microsoft VS Code\bin
[11:12:25 AM] [General] [Info]     C:\Users\DELL\AppData\Roaming\npm
[11:12:25 AM] [General] [Info] Found Flutter project at C:\Users\DELL\Desktop\Writer's Haven\writerHaven:
            Mobile? true
            Web? false
            Create Trigger? false
            Flutter Repo? false
[11:12:25 AM] [General] [Info] Searching for flutter.bat
[11:12:25 AM] [General] [Info]     Looking for flutter.bat in:
[11:12:25 AM] [General] [Info]         C:\Users\DELL\Desktop\Writer's Haven\writerHaven
[11:12:25 AM] [General] [Info]         C:\Users\DELL\Desktop\Writer's Haven\writerHaven\bin
[11:12:25 AM] [General] [Info]         C:\flutter\bin\
[11:12:25 AM] [General] [Info]         C:\Users\DELL\Desktop\Writer's Haven\writerHaven\.flutter
[11:12:25 AM] [General] [Info]         C:\Users\DELL\Desktop\Writer's Haven\writerHaven\.flutter\bin
[11:12:25 AM] [General] [Info]         C:\Users\DELL\Desktop\Writer's Haven\writerHaven\vendor\flutter
[11:12:25 AM] [General] [Info]         C:\Users\DELL\Desktop\Writer's Haven\writerHaven\vendor\flutter\bin
[11:12:25 AM] [General] [Info]         C:\Windows\system32
[11:12:25 AM] [General] [Info]         C:\Windows\system32\bin
[11:12:25 AM] [General] [Info]         C:\Windows
[11:12:25 AM] [General] [Info]         C:\Windows\bin
[11:12:25 AM] [General] [Info]         C:\Windows\System32\Wbem
[11:12:25 AM] [General] [Info]         C:\Windows\System32\Wbem\bin
[11:12:25 AM] [General] [Info]         C:\Windows\System32\WindowsPowerShell\v1.0\
[11:12:25 AM] [General] [Info]         C:\Windows\System32\WindowsPowerShell\v1.0\bin
[11:12:25 AM] [General] [Info]         C:\Program Files (x86)\Skype\Phone\
[11:12:25 AM] [General] [Info]         C:\Program Files (x86)\Skype\Phone\bin
[11:12:25 AM] [General] [Info]         C:\Program Files\Git\cmd
[11:12:25 AM] [General] [Info]         C:\Program Files\Git\cmd\bin
[11:12:25 AM] [General] [Info]         C:\Program Files\nodejs\
[11:12:25 AM] [General] [Info]         C:\Program Files\nodejs\bin
[11:12:25 AM] [General] [Info]         C:\Users\DELL\flutter_windows_1.17.0-stable\flutter\bin
[11:12:25 AM] [General] [Info]         E:\Microsoft VS Code\bin
[11:12:25 AM] [General] [Info]         C:\Users\DELL\AppData\Roaming\npm
[11:12:25 AM] [General] [Info]         C:\Users\DELL\AppData\Roaming\npm\bin
[11:12:25 AM] [General] [Info]     Found at:
[11:12:25 AM] [General] [Info]         C:\flutter\bin\
[11:12:25 AM] [General] [Info]         C:\Users\DELL\flutter_windows_1.17.0-stable\flutter\bin
[11:12:25 AM] [General] [Info]     Candidate paths to be post-filtered:
[11:12:25 AM] [General] [Info]         C:\flutter
[11:12:25 AM] [General] [Info]         C:\Users\DELL\flutter_windows_1.17.0-stable\flutter
[11:12:25 AM] [General] [Info]     Found at C:\flutter
[11:12:25 AM] [General] [Info]     Returning SDK path C:\flutter for flutter.bat
[11:12:25 AM] [General] [Info] Searching for dart.exe
[11:12:25 AM] [General] [Info]     Looking for dart.exe in:
[11:12:25 AM] [General] [Info]         C:\flutter\bin\cache\dart-sdk
[11:12:25 AM] [General] [Info]         C:\flutter\bin\cache\dart-sdk\bin
[11:12:25 AM] [General] [Info]         C:\Windows\system32
[11:12:25 AM] [General] [Info]         C:\Windows\system32\bin
[11:12:25 AM] [General] [Info]         C:\Windows
[11:12:25 AM] [General] [Info]         C:\Windows\bin
[11:12:25 AM] [General] [Info]         C:\Windows\System32\Wbem
[11:12:25 AM] [General] [Info]         C:\Windows\System32\Wbem\bin
[11:12:25 AM] [General] [Info]         C:\Windows\System32\WindowsPowerShell\v1.0\
[11:12:25 AM] [General] [Info]         C:\Windows\System32\WindowsPowerShell\v1.0\bin
[11:12:25 AM] [General] [Info]         C:\Program Files (x86)\Skype\Phone\
[11:12:25 AM] [General] [Info]         C:\Program Files (x86)\Skype\Phone\bin
[11:12:25 AM] [General] [Info]         C:\Program Files\Git\cmd
[11:12:25 AM] [General] [Info]         C:\Program Files\Git\cmd\bin
[11:12:25 AM] [General] [Info]         C:\Program Files\nodejs\
[11:12:25 AM] [General] [Info]         C:\Program Files\nodejs\bin
[11:12:25 AM] [General] [Info]         C:\Users\DELL\flutter_windows_1.17.0-stable\flutter\bin
[11:12:25 AM] [General] [Info]         E:\Microsoft VS Code\bin
[11:12:25 AM] [General] [Info]         C:\Users\DELL\AppData\Roaming\npm
[11:12:25 AM] [General] [Info]         C:\Users\DELL\AppData\Roaming\npm\bin
[11:12:25 AM] [General] [Info]         C:\flutter\bin\cache\dart-sdk
[11:12:25 AM] [General] [Info]         C:\flutter\bin\cache\dart-sdk\bin
[11:12:25 AM] [General] [Info]     Found at:
[11:12:25 AM] [General] [Info]     Candidate paths to be post-filtered:
[11:12:25 AM] [General] [Info]     Returning SDK path undefined for dart.exe

我还尝试更改环境变量路径并使用管理员权限直接使用flutter console.bat。甚至使用了 Git Bash 但无济于事。最后我还删除了flutter\bin文件夹中的缓存。我的颤振目录是

C:\Users\DELL\flutter_windows_1.17.0-stable\flutter\bin

4

4 回答 4

1

再跑flutter doctor一次。它将再次下载

在此处输入图像描述

于 2021-09-10T01:33:50.203 回答
1

我在 Windows 上遇到了这个问题,我认为这是由于代理问题。我在github中遇到过这个解决方案,提供了一个类似的问题。不过,我会再次提到主要步骤:

  1. 转到flutter sdk文件夹(在我的情况下它位于C:\src\flutter

  2. bin\internal

  3. 打开文件update_dart_sdk.ps1

  4. 在这行代码之后Import-Module BitsTransfer,在 Try 块中,添加以下内容:

    If($httpProxy = ([System.Uri] $env:http_proxy)){
    $proxyUserInfo = $httpProxy.UserInfo.Split(":")
    $proxyPass = ConvertTo-SecureString $proxyUserInfo[1] -AsPlainText -Force
    $proxyCredential = New-Object System.Management.Automation.PSCredential 
       ($proxyUserInfo[0], $proxyPass)
    Start-BitsTransfer -Source $dartSdkUrl -Destination $dartSdkZip - 
       ProxyUsage Override -ProxyList ($httpProxy.Host + ":" + 
       $httpProxy.Port) -ProxyCredential $proxyCredential - 
       ProxyAuthentication Basic    
    }Else{
      Start-BitsTransfer -Source $dartSdkUrl -Destination $dartSdkZip
    }
    
于 2021-01-29T17:57:43.590 回答
0

我认为颤振需要一个没有管理权限的磁盘存储空间。所以你可以安装在你的D盘上

于 2022-01-01T01:22:34.877 回答
0

尝试在此处找到的此解决方案

  1. 删除 sdk 路径中的文件夹 flutter/bin/cache (此处有详细信息)

  2. 再次运行 flutter doctor -v 将触发下载 Dart SDK

  3. export FLUTTER_STORAGE_BASE_URL= https://storage.flutter-io.cn (这里有详细信息)

  4. 颤振通道稳定(改变颤振通道的一个例子)

  5. flutter doctor -v(触发下载SDK)

编辑:您可以尝试的其他事情:

删除flutter/bin下的Cache文件夹

在 VSCode 中打开另一个 Flutter 项目

在 Flutter 目录中尝试运行dart --version和更新你的 OP

于 2020-05-19T18:39:52.167 回答