Reputation: 129
I'm using Macbook. After I ran flutter channel master and flutter upgrade, I got the error below.
Please is there any solution for this?
Unhandled exception:
Invalid argument(s): Cannot find executable for sysctl.
#0 _getExecutable (package:process/src/interface/local_process_manager.dart:124:5)
#1 LocalProcessManager.runSync
(package:process/src/interface/local_process_manager.dart:91:30)
#2 ErrorHandlingProcessManager.runSync.<anonymous closure>
(package:flutter_tools/src/base/error_handling_io.dart:649:37)
#3 _runSync (package:flutter_tools/src/base/error_handling_io.dart:548:14)
#4 ErrorHandlingProcessManager.runSync
(package:flutter_tools/src/base/error_handling_io.dart:649:12)
#5 _DefaultProcessUtils.runSync (package:flutter_tools/src/base/process.dart:421:51)
#6 _MacOSUtils.hostPlatform (package:flutter_tools/src/base/os.dart:305:25)
#7 _MacOSUtils.name (package:flutter_tools/src/base/os.dart:291:123)
#8 new _DefaultUsage (package:flutter_tools/src/reporting/usage.dart:247:18)
#9 new Usage (package:flutter_tools/src/reporting/usage.dart:81:9)
#10 runInContext.<anonymous closure>
(package:flutter_tools/src/context_runner.dart:247:20)
#11 AppContext._generateIfNecessary.<anonymous closure>
(package:flutter_tools/src/base/context.dart:104:41)
#12 _LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:291:23)
#13 AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:92:20)
#14 AppContext.get (package:flutter_tools/src/base/context.dart:121:32)
#15 flutterUsage (package:flutter_tools/src/globals.dart:55:35)
Upvotes: 1
Views: 323
Reputation: 650
The solution is to first try to find the installation of the sysctl in your system. In some MacOs it is located in /usr/sbin. So, how to discovery it? Do the following command in the teminal: whereis sysctl
or which sysctl
. The result would be something like: /usr/sbin/sysctl
.
After this, add it to the PATH.
# Adding /usr/sbin/ to path
PATH=/usr/sbin/:${PATH}
export PATH
Copy and paste it into the ~/.bash_profile either the ~/.zshrc file.
Restart your terminal (close it and open again) and run flutter doctor
. Is done!
Upvotes: 2