anchor.diff:  
       group('AndroidSdk', () {
         testUsingContext('throws throwsToolExit if AndroidSdk is null', () async {
  -        final String projectPath = await createProject(tempDir,
  -            arguments: <String>['--no-pub', '--template=app']);
  -
  -        await expectLater(() async {
  -          await runBuildApkCommand(
  +        final String projectPath = await createProject(tempDir, arguments: <String>['--no-pub', '--template=app']);
  +
  +        await expectLater(
  +          () => runBuildApkCommand(
               projectPath,
               arguments: <String>['--no-pub'],
  -          );
  -        }, throwsToolExit(
  -          message: 'No Android SDK found. Try setting the ANDROID_SDK_ROOT environment variable',
  -        ));
  +          ),
  +          throwsToolExit(
  +            message: 'No Android SDK found. Try setting the ANDROID_SDK_ROOT environment variable',
  +          ),
  +        );
         },
         overrides: <Type, Generator>{
           AndroidSdk: () => null,
           FlutterProjectFactory: () => FakeFlutterProjectFactory(tempDir),
  -        ProcessManager: () => mockProcessManager,
  +        ProcessManager: () => processManager,
  +        AndroidStudio: () => FakeAndroidStudio(),
         });
       });
   
       testUsingContext('shrinking is enabled by default on release mode', () async {
  -      final String projectPath = await createProject(tempDir,
  -          arguments: <String>['--no-pub', '--template=app']);
  -
  -      await expectLater(() async {
  -        await runBuildApkCommand(projectPath);
  -      }, throwsToolExit(message: 'Gradle task assembleRelease failed with exit code 1'));
  -
  -      verify(mockProcessManager.start(
  -        <String>[
  -          gradlew,
  -          '-q',
  -          '-Ptarget-platform=android-arm,android-arm64,android-x64',
  -          '-Ptarget=${globals.fs.path.join(tempDir.path, 'flutter_project', 'lib', 'main.dart')}',
  -          '-Pdart-obfuscation=false',
  -          '-Ptrack-widget-creation=true',
  -          '-Ptree-shake-icons=true',
  -          'assembleRelease',
  -        ],
  -        workingDirectory: anyNamed('workingDirectory'),
  -        environment: anyNamed('environment'),
  -      )).called(1);
  -    },
  -    overrides: <Type, Generator>{
  -      AndroidSdk: () => mockAndroidSdk,
  -      FlutterProjectFactory: () => FakeFlutterProjectFactory(tempDir),
  -      ProcessManager: () => mockProcessManager,
  +      final String projectPath = await createProject(tempDir, arguments: <String>['--no-pub', '--template=app']);
  +      processManager.addCommand(FakeCommand(
  +        command: <String>[
  +          gradlew,
  +          '-q',
  +          '-Ptarget-platform=android-arm,android-arm64,android-x64',
  +          '-Ptarget=${globals.fs.path.join(tempDir.path, 'flutter_project', 'lib', 'main.dart')}',
  +          '-Pdart-obfuscation=false',
  +          '-Ptrack-widget-creation=true',
  +          '-Ptree-shake-icons=true',
  +          'assembleRelease',
  +        ],
  +        exitCode: 1,
  +      ));
  +
  +      await expectLater(
  +        () => runBuildApkCommand(projectPath),
  +        throwsToolExit(message: 'Gradle task assembleRelease failed with exit code 1'),
  +      );
  +      expect(processManager, hasNoRemainingExpectations);
  +    },
  +    overrides: <Type, Generator>{
  +      AndroidSdk: () => mockAndroidSdk,
  +      FlutterProjectFactory: () => FakeFlutterProjectFactory(tempDir),
  +      ProcessManager: () => processManager,
  +      AndroidStudio: () => FakeAndroidStudio(),
       });
   
       testUsingContext('--split-debug-info is enabled when an output directory is provided', () async {
  -      final String projectPath = await createProject(tempDir,
  -          arguments: <String>['--no-pub', '--template=app']);
  -
  -      await expectLater(() async {
  -        await runBuildApkCommand(projectPath, arguments: <String>['--split-debug-info=${tempDir.path}']);
  -      }, throwsToolExit(message: 'Gradle task assembleRelease failed with exit code 1'));
  -
  -      verify(mockProcessManager.start(
  -        <String>[
  +      final String projectPath = await createProject(tempDir, arguments: <String>['--no-pub', '--template=app']);
  +      processManager.addCommand(FakeCommand(
  +        command: <String>[
             gradlew,
             '-q',
             '-Ptarget-platform=android-arm,android-arm64,android-x64',
  
positive.code: 
  // @dart = 2.8
  
  import 'dart:io' hide Directory;
  
  import 'package:args/command_runner.dart';
  import 'package:flutter_tools/src/android/android_builder.dart';
  import 'package:flutter_tools/src/android/android_sdk.dart';
  import 'package:flutter_tools/src/base/file_system.dart';
  import 'package:flutter_tools/src/cache.dart';
  import 'package:flutter_tools/src/commands/build_apk.dart';
  import 'package:flutter_tools/src/convert.dart';
  import 'package:flutter_tools/src/globals_null_migrated.dart' as globals;
  import 'package:flutter_tools/src/project.dart';
  import 'package:flutter_tools/src/reporting/reporting.dart';
  import 'package:mockito/mockito.dart';
  
  import '../../src/android_common.dart';
  import '../../src/common.dart';
  import '../../src/context.dart';
  import '../../src/test_flutter_command_runner.dart';
  
  void main() {
  
negative.code:           '-Ptree-shake-icons=true',
            'assembleRelease',
          ],
          exitCode: 1,
        ));
  
        await expectLater(
          () => runBuildApkCommand(projectPath, arguments: <String>['--split-debug-info=${tempDir.path}']),
          throwsToolExit(message: 'Gradle task assembleRelease failed with exit code 1'),
        );
        expect(processManager, hasNoRemainingExpectations);
      },
      overrides: <Type, Generator>{
        AndroidSdk: () => mockAndroidSdk,
        FlutterProjectFactory: () => FakeFlutterProjectFactory(tempDir),
        ProcessManager: () => processManager,
        AndroidStudio: () => FakeAndroidStudio(),
      });
  
      testUsingContext('--extra-front-end-options are provided to gradle project', () async {
        final String projectPath = await createProject(tempDir, arguments: <String>['--no-pub', '--template=app']);
        processManager.addCommand(FakeCommand(
          command: <String>[
            gradlew,
            '-q',
            '-Ptarget-platform=android-arm,android-arm64,android-x64',
  