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
[tool_crash] StateError (Bad state: No element) in testCompilerBuildNativeAssets #192933
In Flutter 3.47.3 crash telemetry, testCompilerBuildNativeAssets threw an unhandled StateError: Bad state: No element (36 crashes in the first 7 days post-release).
Stack Trace
Iterable.firstWhere at dart:core/iterable.dart:722
testCompilerBuildNativeAssets at package:flutter_tools/src/isolated/native_assets/test/native_assets.dart:37
TestCompilerNativeAssetsBuilderImpl.build at package:flutter_tools/src/isolated/native_assets/test/native_assets.dart:22
TestCommand.runCommand at package:flutter_tools/src/commands/test.dart:504
Cause
In package:flutter_tools/src/isolated/native_assets/test/native_assets.dart:
firstWhere throws StateError when no package in buildInfo.packageConfig.packages has its root matching projectUri (for example, in pub workspaces, symlinked directories, or when invoking flutter test from a sub-directory).
Proposed Fix
Use firstWhereOrNull or check against root URIs and fall back gracefully to the target project/package name from pubspec rather than crashing.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
[flutter_tools] Fix StateError in testCompilerBuildNativeAssets when …
[beta] [flutter_tools] Fix StateError in testCompilerBuildNativeAsset…
[flutter_tools] Fix StateError in testCompilerBuildNativeAssets when …
[stable] [flutter_tools] Fix StateError in testCompilerBuildNativeAss…
[flutter_tools] Fix StateError in testCompilerBuildNativeAssets when …
github-actions commentedon Nov 3, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.