美文网首页
解决flutter attach Bad UTF-8 enco

解决flutter attach Bad UTF-8 enco

作者: 青年别来无恙 | 来源:发表于2019-05-30 14:06 被阅读0次

    问题

     DKFlutterModuleSale git:(Dev1.0.1) ✗ flutter attach
    Checking for advertised Dart observatories...
    Unhandled exception:
    FormatException: Bad UTF-8 encoding 0xc (at offset 22)
    #0      _Utf8Decoder.convert (dart:convert/utf.dart:444:15)
    #1      Utf8Decoder.convert (dart:convert/utf.dart:327:13)
    #2      Utf8Codec.decode (dart:convert/utf.dart:59:56)
    #3      _readFQDN (package:multicast_dns/src/packet.dart:165:24)
    #4      decodeMDnsResponse.readResourceRecord (package:multicast_dns/src/packet.dart:240:36)
    #5      decodeMDnsResponse (package:multicast_dns/src/packet.dart:350:55)
    #6      MDnsClient._handleIncoming (package:multicast_dns/multicast_dns.dart:194:45)
    #7      _rootRunUnary (dart:async/zone.dart:1136:13)
    #8      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
    #9      _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
    #10     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
    #11     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
    #12     _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
    #13     _StreamController._add (dart:async/stream_controller.dart:640:7)
    #14     _StreamController.add (dart:async/stream_controller.dart:586:5)
    #15     new _RawDatagramSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1859:33)
    #16     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:844:14)
    #17     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
    #18     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
    #19     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:115:13)
    #20     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:5)
    

    解决方法

    打开Android Studio --> file --> Other Settings -->Preferences for New Projects --> File Encodings
    设置Project Encoding 为 UTF-8


    屏幕快照 2019-05-30 下午2.05.43.png

    相关文章

      网友评论

          本文标题:解决flutter attach Bad UTF-8 enco

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