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';
import 'package:path/path.dart' as path;
import '../android/android_device.dart';
import '../application_package.dart';
import '../globals.dart';
import '../runner/flutter_command.dart';
......@@ -47,18 +48,19 @@ class RefreshCommand extends FlutterCommand {
return result;
}
AndroidDevice device = deviceForCommand;
String activity = argResults['activity'];
if (activity == null) {
if (applicationPackages.android != null) {
activity = applicationPackages.android.launchActivity;
AndroidApk apk = applicationPackages.getPackageForPlatform(device.platform);
if (apk != null) {
activity = apk.launchActivity;
} else {
printError('Unable to find the activity to be refreshed.');
return 1;
}
}
AndroidDevice device = deviceForCommand;
bool success = await device.refreshSnapshot(activity, snapshotPath);
if (!success) {
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