Repository navigation
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: buildBuilding flutter applications with the toolBuilding flutter applications with the toolc: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 3.47Found to occur in 3.47Found to occur in 3.47has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyt: hot reloadReloading code during "flutter run"Reloading code during "flutter run"team-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Description
Steps to reproduce
flutter create --platforms ios --org com.example app && cd app- Replace
lib/main.dartwith the code sample below. - Build a debug app for the simulator:
flutter build ios --simulator --debug - Install it on a booted simulator:
xcrun simctl install <udid> build/ios/iphonesimulator/Runner.app - Start
flutter attach -d <udid>, then launch the app:xcrun simctl launch <udid> com.example.app - Change
'Hello'to'Hello again'inlib/main.dartand pressr.
Expected results
The text changes to "Hello again", as with flutter run.
Actual results
The app shows a red error screen with Lookup failed: _location. After one hot restart (R), hot reloads work.
flutter build ios has no --track-widget-creation option and writes TRACK_WIDGET_CREATION=false to ios/Flutter/Generated.xcconfig, while flutter attach defaults to --track-widget-creation. flutter build apk has the option and defaults it to on.
Attaching with flutter attach -d <udid> --no-track-widget-creation works around it. I'd expect flutter build ios --debug to track widget creation by default and accept --[no-]track-widget-creation like flutter build apk.
#109602 looks like the same mismatch for add-to-app modules built from Xcode, but I haven't confirmed that.
Code sample
import 'package:flutter/widgets.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const Center(
child: Text('Hello', textDirection: TextDirection.ltr),
);
}
}Logs
Performing hot reload...
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following _CompileTimeError was thrown building MyApp(dirty):
Lookup failed: _location in package:flutter/src/widgets/widget_inspector.dart in @fields in Widget
in package:flutter/src/widgets/framework.dart
Widget creation tracking is currently disabled. Enabling it enables improved error messages. It can
be enabled by passing `--track-widget-creation` to `flutter run` or `flutter test`.
When the exception was thrown, this was the stack:
#0 StatelessElement.build (package:flutter/src/widgets/framework.dart:5902:49)
#1 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5830:15)
#2 Element.rebuild (package:flutter/src/widgets/framework.dart:5542:7)
#3 BuildScope._tryRebuild (package:flutter/src/widgets/framework.dart:2763:15)
#4 BuildScope._flushDirtyElements (package:flutter/src/widgets/framework.dart:2820:11)
#5 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:3124:18)
...
Reloaded 1 of 533 libraries in 215ms (compile: 11 ms, reload: 31 ms, reassemble: 69 ms).
Flutter Doctor output
[✓] Flutter (Channel stable, 3.47.8, on macOS 26.6.1 25G76 darwin-arm64, locale en-DE)
[✓] Xcode - develop for iOS and macOS (Xcode 27.2)
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: buildBuilding flutter applications with the toolBuilding flutter applications with the toolc: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 3.47Found to occur in 3.47Found to occur in 3.47has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyt: hot reloadReloading code during "flutter run"Reloading code during "flutter run"team-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Activity
saurabh-mirajkar commentedon Nov 3, 2026
@saibotma Thanks for the detailed report. I reproduced this on both Flutter 3.47.9 stable and Flutter 3.50 master using an iOS Simulator. Labelling and routing it to the iOS team for further investigation.
Related: #109602
cbracken commentedon Nov 5, 2026
/cc @vashworth @bkonyi, while this appears to exist on stable, intuitively this seems like it's got to be a regression. Marked as P1 though feels like the case could be made for P2.
bkonyi commentedon Nov 6, 2026
Dropping to P2 since it looks like this has actually been an issue for years (it looks like it regressed after #56094).
Fix is up for review: #196078.
[flutter_tools] Register trackWidgetCreation in AppleBuildOptionsBund…