Fix for how flutter refresh locates the Android package manifest (#3791)
This commit is contained in:
parent
09dde8718b
commit
2ea3c9471d
@ -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.');
|
||||
|
Loading…
x
Reference in New Issue
Block a user