diff --git a/dev/tools/bin/generate_gradle_lockfiles.dart b/dev/tools/bin/generate_gradle_lockfiles.dart index 9ca5702141..10fd873363 100644 --- a/dev/tools/bin/generate_gradle_lockfiles.dart +++ b/dev/tools/bin/generate_gradle_lockfiles.dart @@ -179,7 +179,11 @@ void main(List arguments) { final String appDirectory = androidDirectory.parent.absolute.path; // Fetch pub dependencies. - exec('flutter', ['pub', 'get'], workingDirectory: appDirectory); + final String flutterPath = repoRoot + .childDirectory('bin') + .childFile('flutter') + .path; + exec(flutterPath, ['pub', 'get'], workingDirectory: appDirectory); // Verify that the Gradlew wrapper exists. final File gradleWrapper = androidDirectory.childFile('gradlew');