Commit 2ea3c947 authored by Jason Simmons's avatar Jason Simmons

Fix for how flutter refresh locates the Android package manifest (#3791)

parent 09dde871
...@@ -8,6 +8,7 @@ import 'dart:io'; ...@@ -8,6 +8,7 @@ import 'dart:io';
import 'package:path/path.dart' as path; import 'package:path/path.dart' as path;
import '../android/android_device.dart'; import '../android/android_device.dart';
import '../application_package.dart';
import '../globals.dart'; import '../globals.dart';
import '../runner/flutter_command.dart'; import '../runner/flutter_command.dart';
...@@ -47,18 +48,19 @@ class RefreshCommand extends FlutterCommand { ...@@ -47,18 +48,19 @@ class RefreshCommand extends FlutterCommand {
return result; return result;
} }
AndroidDevice device = deviceForCommand;
String activity = argResults['activity']; String activity = argResults['activity'];
if (activity == null) { if (activity == null) {
if (applicationPackages.android != null) { AndroidApk apk = applicationPackages.getPackageForPlatform(device.platform);
activity = applicationPackages.android.launchActivity; if (apk != null) {
activity = apk.launchActivity;
} else { } else {
printError('Unable to find the activity to be refreshed.'); printError('Unable to find the activity to be refreshed.');
return 1; return 1;
} }
} }
AndroidDevice device = deviceForCommand;
bool success = await device.refreshSnapshot(activity, snapshotPath); bool success = await device.refreshSnapshot(activity, snapshotPath);
if (!success) { if (!success) {
printError('Error refreshing snapshot on $device.'); printError('Error refreshing snapshot on $device.');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment