Flutter问题汇总
2019-07-16 本文已影响25人
万能的小芳芳
到Flutter SDK
目录下,执行命令git tag
可看到所有版本;执行git checkout v1.8.0(你想切到的版本)
,即可切换到对应版本。
问题
执行flutter命令都提示Oops; flutter has exited unexpectedly.
;此时会将错误日志发送给google,木有梯子的同学自然会发送失败,发送失败会将日志文件存于本地目录中(路径在终端中有提示)。
flutter doctor
Oops; flutter has exited unexpectedly.
Sending crash report to Google.
Failed to send crash report due to a network error: SocketException: OS Error: Operation timed out, errno = 60,
address = clients2.google.com, port = 60818
Crash report written to /Users/hello/git/myflutter/flutter_08.log;
please let us know at https://github.com/flutter/flutter/issues.
打开日志文件提示,能清晰地看出问题原因:
## command
flutter
## exception
# 有时是这样
FileSystemException: FileSystemException: Cannot open file, path = '/Users/hello/soft/myflutter/version' (OS Error: Permission denied, errno = 13)
# 或者是这样
FileSystemException: FileSystemException: Cannot open file, path = '/Users/hello/soft/myflutter/bin/cache/lockfile' (OS Error: Permission denied, errno = 13)
#0 _File.open.<anonymous closure> (dart:io/file_impl.dart:364:9)
#1 _rootRunUnary (dart:async/zone.dart:1132:38)
#2 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#3 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#4 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#5 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#6 Future._completeWithValue (dart:async/future_impl.dart:483:5)
#7 Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:513:7)
#8 _rootRun (dart:async/zone.dart:1124:13)
#9 _CustomZone.run (dart:async/zone.dart:1021:19)
#10 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#11 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#12 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#13 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:115:13)
#14 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:5)
/Users/hello/soft/myflutter/version
/Users/hello/soft/myflutter/bin/cache/lockfile
日志提示指定文件没有权限;其实都是可执行文件,赋予他们执行权限即可:
chmod -R 755 /Users/hello/soft/myflutter/version
chmod -R 755 /Users/hello/soft/myflutter/bin/cache/lockfile