Reputation: 125
I have created simple flutter app with images and animations,
It runs very smoothly when I debug and run app using 'flutter run' command
But when I try to hot reload, it timeout with below error list and I always need to redebug flutter app and run It again.
Initializing hot reload...
Syncing files to device Redmi Note 4...
TimeoutException: Request to Dart VM Service timed out:
ext.flutter.evict({value
: AssetManifest.json, isolateId: isolates/428680573})
#0 VM.invokeRpcRaw (package:flutter_tools/src/vmservice.dart:741)
<asynchronous suspension>
#1 Isolate.invokeRpcRaw
(package:flutter_tools/src/vmservice.dart:998)
#2 Isolate.invokeFlutterExtensionRpcRaw
(package:flutter_tools/src/vmservic
e.dart:1127)
<asynchronous suspension>
#3 Isolate.flutterEvictAsset
(package:flutter_tools/src/vmservice.dart:1204
)
<asynchronous suspension>
#4 HotRunner._evictDirtyAssets
(package:flutter_tools/src/run_hot.dart:302)
<asynchronous suspension>
#5 HotRunner._reloadSources
(package:flutter_tools/src/run_hot.dart:615)
<asynchronous suspension>
#6 HotRunner.restart (package:flutter_tools/src/run_hot.dart:457)
<asynchronous suspension>
#7 HotRunner.handleTerminalCommand
(package:flutter_tools/src/run_hot.dart:
236)
<asynchronous suspension>
#8 ResidentRunner.processTerminalInput
(package:flutter_tools/src/resident_
runner.dart:740)
<asynchronous suspension>
#9 _rootRunUnary (dart:async/zone.dart:1134)
#10 _CustomZone.runUnary (dart:async/zone.dart:1031)
#11 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933)
#12 _BufferingStreamSubscription._sendData
(dart:async/stream_impl.dart:330)
#13 _BufferingStreamSubscription._add
(dart:async/stream_impl.dart:257)
#14 _SyncBroadcastStreamController._sendData
(dart:async/broadcast_stream_co
ntroller.dart:379)
#15 _BroadcastStreamController.add
(dart:async/broadcast_stream_controller.d
art:254)
#16 _AsBroadcastStreamController.add
(dart:async/broadcast_stream_controller
.dart:480)
#17 _rootRunUnary (dart:async/zone.dart:1134)
#18 _CustomZone.runUnary (dart:async/zone.dart:1031)
#19 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933)
#20 _BufferingStreamSubscription._sendData
(dart:async/stream_impl.dart:330)
#21 _BufferingStreamSubscription._add
(dart:async/stream_impl.dart:257)
#22 _SinkTransformerStreamSubscription._add
(dart:async/stream_transformers.
dart:68)
#23 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15)
#24 _StringAdapterSink.add (dart:convert/string_conversion.dart:268)
#25 _SimpleAsciiDecoderSink.add (dart:convert/ascii.dart:298)
#26 _ConverterStreamEventSink.add
(dart:convert/chunked_conversion.dart:86)
#27 _SinkTransformerStreamSubscription._handleData
(dart:async/stream_transf
ormers.dart:120)
#28 _rootRunUnary (dart:async/zone.dart:1134)
#29 _CustomZone.runUnary (dart:async/zone.dart:1031)
#30 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933)
#31 _BufferingStreamSubscription._sendData
(dart:async/stream_impl.dart:330)
#32 _BufferingStreamSubscription._add
(dart:async/stream_impl.dart:257)
#33 _StreamController&&_SyncStreamControllerDispatch._sendData
(dart:async/s
tream_controller.dart:763)
#34 _StreamController._add (dart:async/stream_controller.dart:639)
#35 _StreamController.add (dart:async/stream_controller.dart:585)
#36 _Socket._onData (dart:io-patch/socket_patch.dart:1654)
#37 _rootRunUnary (dart:async/zone.dart:1138)
#38 _CustomZone.runUnary (dart:async/zone.dart:1031)
#39 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933)
#40 _BufferingStreamSubscription._sendData
(dart:async/stream_impl.dart:330)
#41 _BufferingStreamSubscription._add
(dart:async/stream_impl.dart:257)
#42 _StreamController&&_SyncStreamControllerDispatch._sendData
(dart:async/s
tream_controller.dart:763)
#43 _StreamController._add (dart:async/stream_controller.dart:639)
#44 _StreamController.add (dart:async/stream_controller.dart:585)
#45 new _RawSocket.<anonymous closure> (dart:io-
patch/socket_patch.dart:1231
)
#46 _NativeSocket.issueReadEvent.issue (dart:io-
patch/socket_patch.dart:784)
#47 _microtaskLoop (dart:async/schedule_microtask.dart:41)
#48 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#49 _runPendingImmediateCallback (dart:isolate-
patch/dart:isolate/isolate_pa
tch.dart:113)
#50 _RawReceivePortImpl._handleMessage (dart:isolate-
patch/dart:isolate/isol
ate_patch.dart:166)
Application finished.
This error is not showing detail about where it is occuring.
If it is problem with loading image asset, I've added images in images directory in root folder, and also given asset links in pubspec.yaml file
Images are displaying well now while I run app but app refused to hot restart or hot reload.
I tried reinstall Flutter SDK and also tried in other project samples, hot reload works well in other projects.
Upvotes: 0
Views: 2089
Reputation: 125
Okay I found the issue, It was problem with the timer class I was using for splash screen,
I didn't use async
with calling method that use Duration
and Timer
Class and it runs on main thread,
It was working well without async
but it also created issue for hot reload as it was not running on background.
Upvotes: 1