[CP-beta][ Tool ] Fix flutter run -d all crash (#180845)#181163
[CP-beta][ Tool ] Fix flutter run -d all crash (#180845)#181163auto-submit[bot] merged 1 commit intoflutter:flutter-3.41-candidate.0from
flutter run -d all crash (#180845)#181163Conversation
661b8ed introduced changes related to build hooks that made assumptions about the value of the detected target platform, effectively restricting `flutter run` to targeting single devices. This change fixes the regression which prevented developers from deploying their application to multiple devices with `flutter run -d all`. Fixes flutter#179857
|
This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter. Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed. |
There was a problem hiding this comment.
Code Review
This pull request addresses a crash that occurs when using flutter run -d all with multiple devices. The core of the change is in HotRunner, which now correctly handles multiple target platforms by using a Set<TargetPlatform> to store all device platforms, rather than a single _targetPlatform. The _updateDevFS method has been updated to iterate over this set, ensuring assets are built for each distinct platform. A regression test has also been added to verify the fix for scenarios involving multiple devices.
e4f9901
into
flutter:flutter-3.41-candidate.0
Issue Link:
What is the link to the issue this cherry-pick is addressing?
#179857
Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)?
Does it impact development (ex. flutter doctor crashes when Android Studio is installed),
or the shipping of production apps (the app crashes on launch).
This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick.
flutter run -d allcauses the tool to crash if multiple devices are available.Changelog Description:
Explain this cherry pick:
See best practices for examples.
flutter run -d allcauses the tool to crash if multiple devices are available.Workaround:
Is there a workaround for this issue?
No.
Risk:
What is the risk level of this cherry-pick?
Test Coverage:
Are you confident that your fix is well-tested by automated tests?
Validation Steps:
What are the steps to validate that this fix works?
Run
flutter run -d allwith multiple non-web devices available and verify the application is deployed to all non-web devices.