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 '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 {
|
|||||||
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.');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user