google / flutter-desktop-embedding

Experimental plugins for Flutter for Desktop
Apache License 2.0
7.11k stars 608 forks source link

Example app disconnecting from logger/debugger due to malformed json #356

Closed provokateurin closed 5 years ago

provokateurin commented 5 years ago

Describe the bug I updated this project and the example app stopped working in debug mode. The app starts fine, but the logger/debugger stops. I'm getting this error:

Launching lib/main.dart on Linux in debug mode...
Building Linux application...                                           
Error initializing DevFS: FormatException: Unexpected character (at character
293)
...ns":0,"avgCollectionPeriodMillis":0,000000,"used":524288,"capacity":2097...
                                       ^

Lost connection to device.
Unhandled exception:
FormatException: Unexpected character (at character 293)
...ns":0,"avgCollectionPeriodMillis":0,000000,"used":524288,"capacity":2097...
                                       ^

#0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1392:5)
#1      _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:922:48)
#2      _parseJson (dart:convert-patch/convert_patch.dart:29:10)
#3      JsonDecoder.convert (dart:convert/json.dart:493:36)
#4      JsonCodec.decode (dart:convert/json.dart:151:41)
#5      jsonDecode (dart:convert/json.dart:94:10)
#6      _MapStream._handleData (dart:async/stream_pipe.dart:227:21)
#7      _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:164:13)
#8      _rootRunUnary (dart:async/zone.dart:1132:38)
#9      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#10     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#11     CastStreamSubscription._onData (dart:_internal/async_cast.dart:81:11)
#12     _rootRunUnary (dart:async/zone.dart:1132:38)
#13     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#14     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#15     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#16     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#17     _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:132:11)
#18     _ForwardingStream._handleData (dart:async/stream_pipe.dart:98:10)
#19     _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:164:13)
#20     _rootRunUnary (dart:async/zone.dart:1132:38)
#21     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#22     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#23     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#24     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#25     _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
#26     _StreamController._add (dart:async/stream_controller.dart:640:7)
#27     _StreamController.add (dart:async/stream_controller.dart:586:5)
#28     new _WebSocketImpl._fromSocket.<anonymous closure> (dart:_http/websocket_impl.dart:1138:21)
#29     _rootRunUnary (dart:async/zone.dart:1132:38)
#30     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#31     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#32     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#33     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#34     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
#35     _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#36     _WebSocketProtocolTransformer._messageFrameEnd (dart:_http/websocket_impl.dart:334:22)
#37     _WebSocketProtocolTransformer.add (dart:_http/websocket_impl.dart:229:46)
#38     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
#39     _rootRunUnary (dart:async/zone.dart:1132:38)
#40     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#41     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#42     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#43     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#44     _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
#45     _StreamController._add (dart:async/stream_controller.dart:640:7)
#46     _StreamController.add (dart:async/stream_controller.dart:586:5)
#47     _Socket._onData (dart:io-patch/socket_patch.dart:1774:41)
#48     _rootRunUnary (dart:async/zone.dart:1136:13)
#49     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#50     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#51     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#52     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#53     _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
#54     _StreamController._add (dart:async/stream_controller.dart:640:7)
#55     _StreamController.add (dart:async/stream_controller.dart:586:5)
#56     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1323:33)
#57     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:844:14)
#58     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#59     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#60     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:115:13)
#61     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:5)

(Sometimes the stack trace is missing)

Development Environment (please complete the following information):

Doctor Output For build issues, please provide the output of flutter doctor -v:

[✓] Flutter (Channel dev, v1.5.8, on Linux, locale en_US.UTF-8)
    • Flutter version 1.5.8 at /home/jld3103/flutter
    • Framework revision 0ba67226ee (3 days ago), 2019-04-24 17:18:28 -0700
    • Engine revision c63d1cf9c9
    • Dart version 2.3.0 (build 2.3.0-dev.0.1 1f1592edce)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /home/jld3103/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /home/jld3103/Android/Sdk
    • Java binary at: /home/jld3103/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/183.5452501/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b16-5323222)
    • All Android licenses accepted.

[✓] Android Studio (version 3.4)
    • Android Studio at /home/jld3103/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/183.5452501
    • Flutter plugin version 35.0.1
    • Dart plugin version 183.5901
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b16-5323222)

[✓] Connected device (1 available)
    • Linux • Linux • linux-x64 • Linux

• No issues found!
stuartmorgan commented 5 years ago

This is below the level of FDE; please re-file this in Flutter issue tracker (and reference this issue for cross-linking)

"avgCollectionPeriodMillis":0,000000

It looks suspiciously like the JSON encoder used a locale settings for stringification of the float (which would presumably be a bug). When you re-file, please include whether you have an OS-level setting to use , as the decimal separator on your machine.

provokateurin commented 5 years ago

Yes you were right. The json parser was the problem. flutter/flutter#31737 Maybe this issue has to go deeper into the dart repo.