Repository navigation
Scribble throws RenderBox was not laid out: RenderFractionalTranslation#23d29 NEEDS-LAYOUT NEEDS-PAINT when home & initial route are specified #127803
Copy link
Copy link
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: tabletTablets and landscape phonesTablets and landscape phonesa: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsf: routesNavigator, Router, and related APIs.Navigator, Router, and related APIs.found in release: 3.10Found to occur in 3.10Found to occur in 3.10found in release: 3.11Found to occur in 3.11Found to occur in 3.11frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has 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 specificallyteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
The following error occurs when focusing a TextField widget using the Apple Pencil on iPad. The error is not raised when tapping with a finger on the field to use the virtual keyboard. Scribbe does not work when this error is raised.
logs
════════ Exception caught by services library ══════════════════════════════════
The following assertion was thrown during method call TextInputClient.requestElementsInRect:
RenderBox was not laid out: RenderFractionalTranslation#23d29 NEEDS-LAYOUT NEEDS-PAINT
'package:flutter/src/rendering/box.dart':
box.dart:1
Failed assertion: line 1966 pos 12: 'hasSize'
2
Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.md
When the exception was thrown, this was the stack
#2 RenderBox.size
box.dart:1966
#3 RenderFractionalTranslation.applyPaintTransform
proxy_box.dart:2988
#4 RenderObject.getTransformTo
object.dart:3174
#5 _ScribbleFocusableState.bounds
editable_text.dart:5006
#6 _ScribbleFocusableState.isInScribbleRect
editable_text.dart:4984
#7 TextInput._handleTextInputInvocation.<anonymous closure>
text_input.dart:1771
#8 WhereIterator.moveNext (dart:_internal/iterable.dart:441:13)
#9 MappedIterator.moveNext (dart:_internal/iterable.dart:392:19)
#10 new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#11 new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#12 new List.of (dart:core-patch/array_patch.dart:47:28)
#13 Iterable.toList (dart:core/iterable.dart:494:7)
#14 TextInput._handleTextInputInvocation
text_input.dart:1779
#15 TextInput._loudlyHandleTextInputInvocation
text_input.dart:1746
#16 MethodChannel._handleAsMethodCall
platform_channel.dart:547
#17 MethodChannel.setMethodCallHandler.<anonymous closure>
platform_channel.dart:540
#18 _DefaultBinaryMessenger.setMessageHandler.<anonymous closure>
binding.dart:479
#19 _invoke2 (dart:ui/hooks.dart:174:13)
#20 _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:40:5)
#21 _Channel.push (dart:ui/channel_buffers.dart:130:31)
#22 ChannelBuffers.push (dart:ui/channel_buffers.dart:326:17)
#23 PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:686:22)
#24 _dispatchPlatformMessage (dart:ui/hooks.dart:86:31)
(elided 2 frames from class _AssertionError)
call: MethodCall(TextInputClient.requestElementsInRect, [271.5, 371.5, 60, 120])
════════════════════════════════════════════════════════════════════════════════
flutter doctor -v
[✓] Flutter (Channel stable, 3.10.2, on macOS 13.0 22A380 darwin-arm64, locale en-CH)
• Flutter version 3.10.2 on channel stable at /Users/marcoancona/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 9cd3d0d9ff (6 days ago), 2023-05-23 20:57:28 -0700
• Engine revision 90fa3ae28f
• Dart version 3.0.2
• DevTools version 2.23.1
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at /Users/marcoancona/Library/Android/sdk
• Platform android-33, build-tools 32.0.0
• Java binary at: ...
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14B47b
• CocoaPods version 1.11.3
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: tabletTablets and landscape phonesTablets and landscape phonesa: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsf: routesNavigator, Router, and related APIs.Navigator, Router, and related APIs.found in release: 3.10Found to occur in 3.10Found to occur in 3.10found in release: 3.11Found to occur in 3.11Found to occur in 3.11frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has 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 specificallyteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Activity
[-]Scribbe issue - RenderBox was not laid out: RenderFractionalTranslation#23d29 NEEDS-LAYOUT NEEDS-PAINT[/-][+]Scribble issue - RenderBox was not laid out: RenderFractionalTranslation#23d29 NEEDS-LAYOUT NEEDS-PAINT[/+]danagbemava-nc commentedon May 30, 2023
Hi @marcoancona, please provide a complete minimal reproducible code sample along with steps to reproduce so that we can investigate this issue. I tested with the counter app with a TextField but I could not reproduce the error.
Thank you
marcoancona commentedon May 30, 2023
Hi @danagbemava-nc ,
While working on the minimal example I could narrow down the problem. The issue seems to only occur if
MaterialAppis used with both ainitialRouteand ahomeas in this example:Now I also found that the documentation says
Warning: When using initialRoute, don’t define a home property.Not sure if this then should be an expected error. Definitely, more guidance on the error message would help.[-]Scribble issue - RenderBox was not laid out: RenderFractionalTranslation#23d29 NEEDS-LAYOUT NEEDS-PAINT[/-][+]Scribble throws `RenderBox was not laid out: RenderFractionalTranslation#23d29 NEEDS-LAYOUT NEEDS-PAINT` when home & initial route are specified [/+]danagbemava-nc commentedon May 31, 2023
Issue is reproducible using the code sample provided in #127803 (comment).
Removing/Commenting home in the sample code makes Scribble work again. Looking at the widget tree in devtools, there are 2
NewWidgetnodes so perhaps that's why the scribble cannot determine where to start and as such throws the error.The error logs are the same as what OP shared above. I agree that improving the error message would be helpful.
Labeling for further insight from the team.
flutter doctor -v
22 remaining items
justinmc commentedon Oct 3, 2024
Moving this to team-text-input since @LongCatIsLooong is taking a look.
flutter-triage-bot commentedon Feb 7, 2025
This issue is assigned to @LongCatIsLooong but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!
flutter-triage-bot commentedon Apr 25, 2025
This issue was assigned to @LongCatIsLooong but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.
justinmc commentedon May 1, 2025
From triage, @LongCatIsLooong thought this was likely a framework issue.