-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworkc: regressionIt was better in the past than it is nowIt was better in the past than it is nowf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.32Found to occur in 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33Found to occur in 3.33frameworkflutter/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 specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Steps to reproduce
- Run this code sample on iOS.
- Long press on selectable text.
I've verified on Android, MacOS & Web, it is working fine. Faced this issue while triaging #91524.
Please check #91524 (comment).
I reproduced the problem without using flutter_markdown.
Expected results
The iOS context menu (copy/select) should appear without throwing errors.
Actual results
The context menu appears, and the system logs an error about an inactive text input connection.
Code sample
Run this code sample
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Selection Error')),
body: const Padding(
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SelectableText(
'This is a selectable paragraph.\nLong press me on iOS.',
),
],
),
),
),
);
}
}Screenshots or Video
| Master & Stable-3.32.0 | Stable 3.29.3 |
|---|---|
Simulator.Screen.Recording.-.iPhone.16.Plus.-.2025-05-17.at.00.37.05.mp4 |
Simulator.Screen.Recording.-.iPhone.16.Plus.-.2025-05-17.at.00.52.28.mp4 |
Logs
Logs
Restarted application in 211ms.
════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building SystemContextMenu(dirty, dependencies: [MediaQuery, _LocalizationsScope-[GlobalKey#513ee]], state: _SystemContextMenuState#7eb05):
Currently, the system context menu can only be shown for an active text input connection
'package:flutter/src/services/text_input.dart':
Failed assertion: line 2759 pos 7: 'TextInput._instance._currentConnection != null'
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=02_bug.yml
The relevant error-causing widget was:
MaterialApp MaterialApp:file:///Users/tirthpatel/StudioProjects/hello_world/lib/main.dart:10:12
When the exception was thrown, this was the stack:
#2 SystemContextMenuController.showWithItems (package:flutter/src/services/text_input.dart:2759:7)
#3 _SystemContextMenuState.build (package:flutter/src/widgets/system_context_menu.dart:167:36)
#4 StatefulElement.build (package:flutter/src/widgets/framework.dart:5823:27)
#5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5715:15)
#6 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5874:11)
#7 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#8 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:5697:5)
#9 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5865:11)
#10 ComponentElement.mount (package:flutter/src/widgets/framework.dart:5691:5)
... Normal element mounting (64 frames)
#74 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4539:16)
#75 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:7159:36)
#76 Element.updateChild (package:flutter/src/widgets/framework.dart:4004:18)
#77 Element.updateChildren (package:flutter/src/widgets/framework.dart:4201:11)
#78 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:7192:17)
#79 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#80 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5738:16)
#81 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5874:11)
#82 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#83 BuildScope._tryRebuild (package:flutter/src/widgets/framework.dart:2694:15)
#84 BuildScope._flushDirtyElements (package:flutter/src/widgets/framework.dart:2752:11)
#85 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:3056:18)
#86 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1259:21)
#87 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:495:5)
#88 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1438:15)
#89 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1351:9)
#90 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1204:5)
#91 _invoke (dart:ui/hooks.dart:331:13)
#92 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:444:5)
#93 _drawFrame (dart:ui/hooks.dart:303:31)
(elided 2 frames from class _AssertionError)
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by widgets library ═══════════════════════════════════
Currently, the system context menu can only be shown for an active text input connection
'package:flutter/src/services/text_input.dart':
Failed assertion: line 2759 pos 7: 'TextInput._instance._currentConnection != null'
The relevant error-causing widget was:
MaterialApp MaterialApp:file:///Users/tirthpatel/StudioProjects/hello_world/lib/main.dart:10:12
════════════════════════════════════════════════════════════════════════════════Flutter Doctor output
Master
[✓] Flutter (Channel master, 3.33.0-1.0.pre.107, on macOS 15.4.1 24E263 darwin-arm64, locale en-IN) [2.1s]
• Flutter version 3.33.0-1.0.pre.107 on channel master at /Users/tirthpatel/Development/flutter_master/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 8ae7b522dc (61 minutes ago), 2025-05-16 10:07:53 -0700
• Engine revision 8ae7b522dc
• Dart version 3.9.0 (build 3.9.0-131.0.dev)
• DevTools version 2.46.0
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [903ms]
• Android SDK at /Users/tirthpatel/Library/Android/sdk
• Emulator version 35.4.9.0 (build_id 13025442) (CL:N/A)
• Platform android-36, build-tools 36.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.3) [611ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16E140
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [7ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.3) [7ms]
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42)
[✓] VS Code (version 1.100.2) [6ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.110.0
[✓] Connected device (4 available) [5.7s]
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 16 (API 36) (emulator)
• iPhone 16 Plus (mobile) • B19185FD-0093-4E49-B587-16642A3EC7D3 • ios • com.apple.CoreSimulator.SimRuntime.iOS-18-4 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 15.4.1 24E263 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 136.0.7103.114
[✓] Network resources [1,331ms]
• All expected network resources are available.
• No issues found!Stable (3.32.0)
[✓] Flutter (Channel stable, 3.32.0, on macOS 15.4.1 24E263 darwin-arm64, locale en-IN) [446ms]
• Flutter version 3.32.0 on channel stable at /Users/tirthpatel/Development/flutter_stable_latest/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision be698c48a6 (34 hours ago), 2025-05-19 12:59:14 -0700
• Engine revision 1881800949
• Dart version 3.8.0
• DevTools version 2.45.1
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [827ms]
• Android SDK at /Users/tirthpatel/Library/Android/sdk
• Platform android-36, build-tools 36.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.3) [448ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16E140
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [9ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.3) [8ms]
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42)
[✓] VS Code (version 1.100.2) [8ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.110.0
[✓] Connected device (2 available) [5.6s]
• macOS (desktop) • macos • darwin-arm64 • macOS 15.4.1 24E263 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 136.0.7103.114
[✓] Network resources [1,624ms]
• All expected network resources are available.
• No issues found!Stable 3.29.3
[✓] Flutter (Channel stable, 3.29.3, on macOS 15.4.1 24E263 darwin-arm64, locale en-IN) [954ms]
• Flutter version 3.29.3 on channel stable at /Users/tirthpatel/Development/flutter_stable/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ea121f8859 (5 weeks ago), 2025-04-11 19:10:07 +0000
• Engine revision cf56914b32
• Dart version 3.7.2
• DevTools version 2.42.3
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [12.5s]
• Android SDK at /Users/tirthpatel/Library/Android/sdk
• Platform android-36, build-tools 36.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.3) [695ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16E140
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [8ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.3) [8ms]
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42)
[✓] VS Code (version 1.100.2) [6ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.110.0
[✓] Connected device (5 available) [5.8s]
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 16 (API 36) (emulator)
• iPhone 16 Plus (mobile) • B19185FD-0093-4E49-B587-16642A3EC7D3 • ios • com.apple.CoreSimulator.SimRuntime.iOS-18-4 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 15.4.1 24E263 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 15.4.1 24E263 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 136.0.7103.114
[✓] Network resources [1,422ms]
• All expected network resources are available.
• No issues found!Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworkc: regressionIt was better in the past than it is nowIt was better in the past than it is nowf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.32Found to occur in 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33Found to occur in 3.33frameworkflutter/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 specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team