美文网首页Flutter
Flutter问题汇总

Flutter问题汇总

作者: 万能的小芳芳 | 来源:发表于2019-07-16 15:18 被阅读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
    

    相关文章

      网友评论

        本文标题:Flutter问题汇总

        本文链接:https://www.haomeiwen.com/subject/jzktlctx.html