无法在Flutter控制台中执行Flutter Doctor命令

时间:2018-07-07 00:19:02

标签: error-handling dart flutter

在Flutter控制台中运行Flutter Doctor命令时,出现此错误。有人可以帮我吗。我尝试同时使用以管理员身份运行(C和D驱动器)的组合在C驱动器中运行

D:\flutter>flutter doctor
CreateProcessW failed 193

CreateProcessW failed 193
Unhandled exception:
ProcessException: %1 is not a valid Win32 application.
    Command: C:\Program Files\Git\cmd\git.EXE rev-parse --abbrev-ref --symbolic @{u}
    #0      _ProcessImpl._runAndWait (dart:io-patch/process_patch.dart:485)
    #1      _runNonInteractiveProcessSync (dart:io-patch/process_patch.dart:631)
    #2      Process.runSync (dart:io-patch/process_patch.dart:66)
    #3      LocalProcessManager.runSync (package:process/src/interface/local_process_manager.dart:83)
    #4      _runWithLoggingSync (package:flutter_tools/src/base/process.dart:321)
    #5      runSync (package:flutter_tools/src/base/process.dart:296)
    #6      _runGit (package:flutter_tools/src/version.dart:449)
    #7      new FlutterVersion (package:flutter_tools/src/version.dart:23)
    #8      runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:64)
    #9      AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:99)
    #10     _HashVMBase&MapMixin&&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/dart:collection/compact_hash.dart:277)
    #11     AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:87)
    #12     AppContext.[] (package:flutter_tools/src/base/context.dart:114)
    #13     FlutterVersion.instance (package:flutter_tools/src/version.dart:170)
    #14     new Usage (package:flutter_tools/src/usage.dart:26)
    #15     runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:76)
    #16     AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:99)
    #17     _HashVMBase&MapMixin&&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/dart:collection/compact_hash.dart:277)
    #18     AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:87)
    #19     AppContext.[] (package:flutter_tools/src/base/context.dart:114)
    #20     Usage.instance (package:flutter_tools/src/usage.dart:52)
    #21     flutterUsage (package:flutter_tools/src/usage.dart:20)
    #22     _handleToolError (package:flutter_tools/runner.dart:113)
    <asynchronous suspension>
    #23     run.<anonymous closure> (package:flutter_tools/runner.dart:63)
    <asynchronous suspension>
    #24     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142)
    <asynchronous suspension>
    #25     _rootRun (dart:async/zone.dart:1126)
    #26     _CustomZone.run (dart:async/zone.dart:1023)
    #27     runZoned (dart:async/zone.dart:1501)
    #28     AppContext.run (package:flutter_tools/src/base/context.dart:141)
    <asynchronous suspension>
    #29     runInContext (package:flutter_tools/src/context_runner.dart:43)
    <asynchronous suspension>
    #30     run (package:flutter_tools/runner.dart:50)
    #31     main (package:flutter_tools/executable.dart:49)
    <asynchronous suspension>
    #32     main (file:///E:/b/build/slave/Windows_Flutter_Packaging/build/archive/flutter/packages/flutter_tools/bin/flutter_tools.dart:8)
    #33     _startIsolate.<anonymous closure> (dart:isolate-patch/dart:isolate/isolate_patch.dart:277)
    #34     _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165) 

3 个答案:

答案 0 :(得分:0)

尝试重新安装git,然后更新路径,以便能够从命令提示符下运行flutter。

有关如何更新路径的更多详细信息,请访问: Update your path

答案 1 :(得分:0)

尽管flutter现在支持空格,但是可能会出现间距问题(例如C:\ Users \ M Junaid),但请尝试将 ANDROID SDK 移到没有空格的自定义位置(例如C :\ Users \ M.Junaid),然后更新变量 ANDROID_HOME (值应与您移动它的位置相同,没有空格)。

答案 2 :(得分:0)

请改为阅读本教程。我知道完全看它很痛苦,但是另一方面,您将可以从头开始运行一个全新,干净的项目。

Flutter tutorial

那之后,我最终购买了完整的课程,并告诉我我没有失望。