mirror of
https://github.com/flutter/flutter
synced 2024-10-14 04:02:56 +00:00
Do not throw if a hot reload is attempted when all Flutter instances on the device have been stopped (#11504)
This can happen if an Android host app has been paused but its process is still running
This commit is contained in:
parent
8ee902c04b
commit
ffe5851eb7
|
@ -467,16 +467,19 @@ class HotRunner extends ResidentRunner {
|
|||
final String entryPath = fs.path.relative(mainPath, from: projectRootPath);
|
||||
if (benchmarkMode)
|
||||
vmReloadTimer.start();
|
||||
Map<String, dynamic> reloadReport;
|
||||
final List<Future<Map<String, dynamic>>> reloadReports = <Future<Map<String, dynamic>>>[];
|
||||
final List<Future<Map<String, dynamic>>> reloadReportFutures = <Future<Map<String, dynamic>>>[];
|
||||
for (FlutterDevice device in flutterDevices) {
|
||||
final List<Future<Map<String, dynamic>>> reports = device.reloadSources(
|
||||
entryPath,
|
||||
pause: pause
|
||||
);
|
||||
reloadReports.addAll(reports);
|
||||
reloadReportFutures.addAll(reports);
|
||||
}
|
||||
reloadReport = (await Future.wait(reloadReports)).first;
|
||||
if (reloadReportFutures.isEmpty) {
|
||||
printError('Unable to hot reload. No instance of Flutter is currently running.');
|
||||
return new OperationResult(1, 'No instances running');
|
||||
}
|
||||
final Map<String, dynamic> reloadReport = (await Future.wait(reloadReportFutures)).first;
|
||||
|
||||
if (!validateReloadReport(reloadReport)) {
|
||||
// Reload failed.
|
||||
|
|
Loading…
Reference in a new issue