You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7280083
Browse filesBrowse the repository at this point in the historyBrowse files
[beta] [flutter_tools] Fix StateError in testCompilerBuildNativeAssets when package root does not match projectUri (#194958)
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.
### Issue Link:
#192933
### Impact Description:
Fixes a `StateError (Bad state: No element)` crash in `testCompilerBuildNativeAssets` when running `flutter test` in directories where the package root URI does not strictly match `projectUri` in `package_config.json` (such as in pub workspaces, monorepos, symlinked project directories, or when ancestor `package_config.json` files are used). This crash blocks affected users from running `flutter test`.
### Changelog Description:
[flutter/192933] When running `flutter test` in pub workspaces, monorepos, or symlinked directories, fix a StateError crash during native assets compilation by falling back to appName matching.
### Workaround:
Run `flutter test` from the exact directory matching the package root or pass `--no-native-assets` when native assets are not required.
### Risk:
### Test Coverage:
Are you confident that your fix is well-tested by automated tests?
### Validation Steps:
Run `flutter test` in a project with a symlinked path or inside a pub workspace member package and verify that `testCompilerBuildNativeAssets` executes cleanly without throwing `StateError (Bad state: No element)`.
0 commit comments