Flutter Doctor 无法在我的 Mac Air M1 芯片中进行全新安装
Flutter Doctor not working on fresh install in my Mac Air M1 chip
我一直在试图找出导致此错误的原因。我关注 https://docs.flutter.dev/get-started/install/macos 并在互联网上搜索其他可能的解决方案,但没有成功。一个帮助将不胜感激。谢谢
设备:Macbook Air M1
OS:大苏尔
尝试从稳定版 - 测试版 - 稳定版切换。设置 - 重新设置路径。更改权限
melchorlapinig@Melchors-MacBook-Air development % flutter doctor -v
The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 _throwFileSystemException (package:flutter_tools/src/base/error_handling_io.dart:820:3)
#2 _handlePosixException (package:flutter_tools/src/base/error_handling_io.dart:761:3)
#3 _runSync (package:flutter_tools/src/base/error_handling_io.dart:614:7)
#4 ErrorHandlingProcessManager.runSync (package:flutter_tools/src/base/error_handling_io.dart:711:12)
#5 _DefaultProcessUtils.runSync (package:flutter_tools/src/base/process.dart:373:51)
#6 AndroidStudio._init (package:flutter_tools/src/android/android_studio.dart:458:39)
#7 new AndroidStudio (package:flutter_tools/src/android/android_studio.dart:40:5)
#8 AndroidStudio.fromMacOSBundle (package:flutter_tools/src/android/android_studio.dart:90:12)
#9 AndroidStudio._allMacOS.<anonymous closure> (package:flutter_tools/src/android/android_studio.dart:316:68)
#10 MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
#11 ListIterator.moveNext (dart:_internal/iterable.dart:342:26)
#12 WhereTypeIterator.moveNext (dart:_internal/iterable.dart:869:20)
#13 new _GrowableList._ofOther (dart:core-patch/growable_array.dart:198:26)
#14 new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#15 new List.of (dart:core-patch/array_patch.dart:51:28)
#16 Iterable.toList (dart:core/iterable.dart:388:12)
#17 AndroidStudio._allMacOS (package:flutter_tools/src/android/android_studio.dart:318:10)
#18 AndroidStudio.allInstalled (package:flutter_tools/src/android/android_studio.dart:247:34)
#19 AndroidStudio.latestValid (package:flutter_tools/src/android/android_studio.dart:232:41)
#20 AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:104:42)
#21 _LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:453:23)
#22 AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:92:20)
#23 AppContext.get (package:flutter_tools/src/base/context.dart:121:32)
#24 AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
#25 AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
#26 androidStudio (package:flutter_tools/src/globals_null_migrated.dart:65:45)
#27 runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:104:32)
#28 AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:104:42)
#29 _LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:453:23)
#30 AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:92:20)
#31 AppContext.get (package:flutter_tools/src/base/context.dart:121:32)
#32 AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
#33 AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
#34 androidLicenseValidator (package:flutter_tools/src/android/android_workflow.dart:28:65)
#35 DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:56:32)
#36 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1290:12)
<asynchronous suspension>
#37 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1140:27)
<asynchronous suspension>
#38 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#39 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#40 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
<asynchronous suspension>
#41 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#42 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
<asynchronous suspension>
#43 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#44 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#45 main (package:flutter_tools/executable.dart:94:3)
<asynchronous suspension>```
您必须更新您的环境 $PATH 变量。
打开文件 $HOME/.zshrc $HOME 是你的主路径
在打开的文件中添加以下行:
export PATH="$PATH:/YOUR_FLUTTER_DIR/flutter/bin"
保存更改并重新启动终端会话。
过程也有记录here
问题解决。您可以在此处查看解决方案:https://github.com/flutter/flutter/issues/96519
我一直在试图找出导致此错误的原因。我关注 https://docs.flutter.dev/get-started/install/macos 并在互联网上搜索其他可能的解决方案,但没有成功。一个帮助将不胜感激。谢谢
设备:Macbook Air M1 OS:大苏尔 尝试从稳定版 - 测试版 - 稳定版切换。设置 - 重新设置路径。更改权限
melchorlapinig@Melchors-MacBook-Air development % flutter doctor -v
The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 _throwFileSystemException (package:flutter_tools/src/base/error_handling_io.dart:820:3)
#2 _handlePosixException (package:flutter_tools/src/base/error_handling_io.dart:761:3)
#3 _runSync (package:flutter_tools/src/base/error_handling_io.dart:614:7)
#4 ErrorHandlingProcessManager.runSync (package:flutter_tools/src/base/error_handling_io.dart:711:12)
#5 _DefaultProcessUtils.runSync (package:flutter_tools/src/base/process.dart:373:51)
#6 AndroidStudio._init (package:flutter_tools/src/android/android_studio.dart:458:39)
#7 new AndroidStudio (package:flutter_tools/src/android/android_studio.dart:40:5)
#8 AndroidStudio.fromMacOSBundle (package:flutter_tools/src/android/android_studio.dart:90:12)
#9 AndroidStudio._allMacOS.<anonymous closure> (package:flutter_tools/src/android/android_studio.dart:316:68)
#10 MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
#11 ListIterator.moveNext (dart:_internal/iterable.dart:342:26)
#12 WhereTypeIterator.moveNext (dart:_internal/iterable.dart:869:20)
#13 new _GrowableList._ofOther (dart:core-patch/growable_array.dart:198:26)
#14 new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#15 new List.of (dart:core-patch/array_patch.dart:51:28)
#16 Iterable.toList (dart:core/iterable.dart:388:12)
#17 AndroidStudio._allMacOS (package:flutter_tools/src/android/android_studio.dart:318:10)
#18 AndroidStudio.allInstalled (package:flutter_tools/src/android/android_studio.dart:247:34)
#19 AndroidStudio.latestValid (package:flutter_tools/src/android/android_studio.dart:232:41)
#20 AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:104:42)
#21 _LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:453:23)
#22 AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:92:20)
#23 AppContext.get (package:flutter_tools/src/base/context.dart:121:32)
#24 AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
#25 AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
#26 androidStudio (package:flutter_tools/src/globals_null_migrated.dart:65:45)
#27 runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:104:32)
#28 AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:104:42)
#29 _LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:453:23)
#30 AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:92:20)
#31 AppContext.get (package:flutter_tools/src/base/context.dart:121:32)
#32 AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
#33 AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
#34 androidLicenseValidator (package:flutter_tools/src/android/android_workflow.dart:28:65)
#35 DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:56:32)
#36 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1290:12)
<asynchronous suspension>
#37 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1140:27)
<asynchronous suspension>
#38 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#39 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#40 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
<asynchronous suspension>
#41 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#42 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
<asynchronous suspension>
#43 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#44 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#45 main (package:flutter_tools/executable.dart:94:3)
<asynchronous suspension>```
您必须更新您的环境 $PATH 变量。
打开文件 $HOME/.zshrc $HOME 是你的主路径
在打开的文件中添加以下行:
export PATH="$PATH:/YOUR_FLUTTER_DIR/flutter/bin"
保存更改并重新启动终端会话。
过程也有记录here
问题解决。您可以在此处查看解决方案:https://github.com/flutter/flutter/issues/96519