Flutter安装失败

时间:2019-08-27 08:43:32

标签: flutter

复制步骤

  1. 关注https://flutter.dev/docs/get-started/install/windows
  2. git clone -b stable https://github.com/flutter/flutter.git
  3. 更新了我的Edit环境变量 image image

日志

    C:\Users\Win10>flutter doctor
    CreateProcessW failed 193

    CreateProcessW failed 193

    CreateProcessW failed 193
    Unhandled exception:
    ProcessException: %1 is not a valid Win32 application.

      Command: C:\Program Files\Git\cmd\git.EXE log -n 1 --pretty=format:%H
    #0      _ProcessImpl._runAndWait (dart:io-patch/process_patch.dart:489:7)
    #1      _runNonInteractiveProcessSync (dart:io-patch/process_patch.dart:634:18)
    #2      Process.runSync (dart:io-patch/process_patch.dart:66:12)
    #3      LocalProcessManager.runSync (package:process/src/interface/local_process_manager.dart:83:20)
    #4      _runWithLoggingSync (package:flutter_tools/src/base/process.dart:343:48)
    #5      runSync (package:flutter_tools/src/base/process.dart:315:10)
    #6      _runGit (package:flutter_tools/src/version.dart:532:10)
    #7      new FlutterVersion (package:flutter_tools/src/version.dart:23:26)
    #8      runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:81:29)
    #9      AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:99:41)
    #10     __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)
    #11     AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:87:20)
    #12     AppContext.get (package:flutter_tools/src/base/context.dart:115:32)
    #13     FlutterVersion.instance (package:flutter_tools/src/version.dart:183:49)
    #14     new Usage (package:flutter_tools/src/usage.dart:60:58)
    #15     runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:101:20)
    #16     AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:99:41)
    #17     __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)
    #18     AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:87:20)
    #19     AppContext.get (package:flutter_tools/src/base/context.dart:115:32)
    #20     Usage.instance (package:flutter_tools/src/usage.dart:84:40)
    #21     flutterUsage (package:flutter_tools/src/usage.dart:54:33)
    #22     _handleToolError (package:flutter_tools/runner.dart:112:7)
    <asynchronous suspension>
    #23     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:69:13)
    <asynchronous suspension>
    #24     _rootRunBinary (dart:async/zone.dart:1148:13)
    #25     _CustomZone.runBinary (dart:async/zone.dart:1037:19)
    #26     runZoned.<anonymous closure> (dart:async/zone.dart:1479:21)
    #27     _CustomZone.handleUncaughtError (dart:async/zone.dart:1003:19)
    #28     Future._propagateToListeners (dart:async/future_impl.dart:589:16)
    #29     Future._completeError (dart:async/future_impl.dart:491:5)
    #30     _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
    #31     _Completer.completeError (dart:async/future_impl.dart:27:5)
    #32     _AsyncAwaitCompleter.completeError (dart:async-patch/async_patch.dart:40:18)
    #33     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart)
    <asynchronous suspension>
    #34     _rootRun (dart:async/zone.dart:1124:13)
    #35     _CustomZone.run (dart:async/zone.dart:1021:19)
    #36     _runZoned (dart:async/zone.dart:1516:10)
    #37     runZoned (dart:async/zone.dart:1500:12)
    #38     run.<anonymous closure> (package:flutter_tools/runner.dart:60:18)
    <asynchronous suspension>
    #39     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
    <asynchronous suspension>
    #40     _rootRun (dart:async/zone.dart:1124:13)
    #41     _CustomZone.run (dart:async/zone.dart:1021:19)
    #42     _runZoned (dart:async/zone.dart:1516:10)
    #43     runZoned (dart:async/zone.dart:1463:12)
    #44     AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
    <asynchronous suspension>
    #45     runInContext (package:flutter_tools/src/context_runner.dart:56:24)
    <asynchronous suspension>
    #46     run (package:flutter_tools/runner.dart:51:10)
    #47     main (package:flutter_tools/executable.dart:62:9)
    <asynchronous suspension>
    #48     main (file:///C:/src/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
    #49     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
    #50     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)

找到了https://github.com/flutter/flutter/issues/19805#issuecomment-478306166Flutter with installation error for %1 is not a valid win32 application,但是我已经遵循了那些研究所说的话,但是这些都没有帮助

1 个答案:

答案 0 :(得分:0)

似乎您没有在环境变量帐户中粘贴 PATH 。 您必须拿起flutter(提取文件夹),然后将路径粘贴到 flutter / bin 在编辑路径表中。 然后尝试从拥有Flutter文件夹的文件夹(在终端中)中运行Flutter Doctor