From 72cc4d6fde1dd9356c8dbe9ca9857692632838d1 Mon Sep 17 00:00:00 2001 From: Ian Fischer Date: Wed, 7 Oct 2015 15:29:13 -0700 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20give=20a=20scary=20error=20abou?= =?UTF-8?q?t=20not=20being=20able=20to=20run=20on=20Android=20if=20there?= =?UTF-8?q?=E2=80=99s=20no=20Android=20device=20connected.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/flutter_tools/lib/src/device.dart | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart index e0f058e074..ed1d9ae536 100644 --- a/packages/flutter_tools/lib/src/device.dart +++ b/packages/flutter_tools/lib/src/device.dart @@ -230,13 +230,15 @@ class AndroidDevice extends _Device { _adbPath = _getAdbPath(); _hasAdb = _checkForAdb(); - // Checking for lollipop only needs to be done if we are starting an - // app, but it has an important side effect, which is to discard any - // progress messages if the adb server is restarted. - _hasValidAndroid = _checkForLollipopOrLater(); + if (isConnected()) { + // Checking for lollipop only needs to be done if we are starting an + // app, but it has an important side effect, which is to discard any + // progress messages if the adb server is restarted. + _hasValidAndroid = _checkForLollipopOrLater(); - if (!_hasAdb || !_hasValidAndroid) { - _logging.severe('Unable to run on Android.'); + if (!_hasAdb || !_hasValidAndroid) { + _logging.severe('Unable to run on Android.'); + } } }