Repository navigation
[iOS 17] Switching between Chinese and English input on the keyboard freezes #134716
Copy link
Copy link
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)Supporting other languages or locales. (aka i18n)a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemse: OS-version specificAffects only some versions of the relevant operating systemAffects only some versions of the relevant operating systemfound in release: 3.13Found to occur in 3.13Found to occur in 3.13found in release: 3.14Found to occur in 3.14Found to occur in 3.14has 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-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
flutter版本:3.13.4
iOS版本:ios17 Developer Beta
the steps:
Step 1 Switch the Chinese keyboard and click the keyboard "I".
Step 2 Switch the English keyboard and enter the character "'" and enter the character "m".
Step 3 Enter the character "."
Then it gets stuck, then it crashes, then it goes back.
Expected results
Normal input "i'm."
Actual results
The process is stuck and crashed
Code sample
Sample code
import 'dart:convert';
import 'dart:core';
import 'package:flutter/material.dart';
// import 'package:lottie/lottie.dart';
// import 'package:shared_preferences/shared_preferences.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
String _mess = '';
Map<String, dynamic>? jj;
// late final SharedPreferences _pers ;
String mData = '{"main_car_series":0,"birthday":931968000,"s_id":0,"real_person":1,"gender":2,"nick_name":"111","cash":1302.62,"flags":"1,2,5","id":27,"head":482,"tencent_appid":14006193}';
late TextEditingController _txtCtr;
late FocusNode _focus;
@override
void initState() {
super.initState();
_txtCtr = TextEditingController();
_focus = FocusNode();
_initData();
}
_initData() async {
// _pers = await SharedPreferences.getInstance();
// jj = mess;
_mess = jj == null? "null" : jj!['s_id'].toString();
// List<String> dd = bb.split(':');
// if(dd.length > 1){
// _counter = int.parse(dd[1]);
// }
setState(() {
});
}
// Map<String, dynamic>? get mess{
// String? str;
// str = _pers.getString("MESS_DATA");
// Map<String, dynamic>? json;
// if(str == null || str.isEmpty){
// str = mData;
// }
// json = jsonDecode(str);
// // ignore: avoid_print
// print('messdata====='+str);
// return json;
// }
void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
_focus.unfocus();
_mess = '计数:'+_counter.toString();
jj!['s_id'] = _counter;
// _pers.setString("MESS_DATA", _mess).then((p){
// // ignore: avoid_print
// print('add====='+mess!);
// });
// saveData();
});
}
// Future<void> saveData() async {
// await _pers.setString("MESS_DATA", jsonEncode(jj));
// }
// Future<void> removeData() async {
// await _pers.remove("MESS_DATA");
// }
void clearData(){
// _pers.remove("MESS_DATA").then((p){
// });
// removeData();
// setState(() {
// });
}
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: Column(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have clicked hhhh the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
Text(
_mess,
style: Theme.of(context).textTheme.headline4,
),
FloatingActionButton(
onPressed: _incrementCounter,
child: const Icon(Icons.add),
),
// Lottie.asset("assets/pot.json",width: 500,height: 500,repeat: true),
TextField(controller: _txtCtr,onTap: () {
// // _focus.requestFocus();
// await Future.delayed(const Duration(milliseconds: 500));
// _focus.unfocus();
// Future.delayed(const Duration(milliseconds: 1000),(){
// _focus.unfocus();
// });
// Future.delayed(const Duration(milliseconds: 1000),(){
// _focus.requestFocus();
// });
// if(_txtCtr.text.isEmpty){
// _txtCtr.text = "1";
// }
// if(_txtCtr.text == "1"){
// _txtCtr.text = '';
// }
},onChanged: (value) {
// if(_txtCtr.text.isEmpty){
// _txtCtr.text = "m";
// }
_mess = _txtCtr.text;
setState(() {
});
},focusNode: _focus,),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: clearData,
tooltip: 'Increment',
child: const Icon(Icons.remove),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Uploading 1694679470.mp4…
Logs
Logs
[Paste your logs here]Flutter Doctor output
The app “Runner” has been killed by the operating system because it is using too much memory.
Domain: IDEDebugSessionErrorDomain
Code: 11
Recovery Suggestion: Use a memory profiling tool to track the process memory usage.
User Info: {
DVTErrorCreationDateKey = "2023-09-14 07:57:40 +0000";
IDERunOperationFailingWorker = DBGLLDBLauncher;
}
--
Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : {
"device_isCoreDevice" = 1;
"device_model" = "iPhone14,2";
"device_osBuild" = "17.0 (21A329)";
"device_platform" = "com.apple.platform.iphoneos";
"dvt_coredevice_version" = "348.1";
"dvt_mobiledevice_version" = "1643.2.4";
"launchSession_schemeCommand" = Run;
"launchSession_state" = 2;
"launchSession_targetArch" = arm64;
"operation_duration_ms" = 180352;
"operation_errorCode" = 11;
"operation_errorDomain" = IDEDebugSessionErrorDomain;
"operation_errorWorker" = DBGLLDBLauncher;
"operation_name" = IDERunOperationWorkerGroup;
"param_debugger_attachToExtensions" = 0;
"param_debugger_attachToXPC" = 1;
"param_debugger_type" = 3;
"param_destination_isProxy" = 0;
"param_destination_platform" = "com.apple.platform.iphoneos";
"param_diag_MainThreadChecker_stopOnIssue" = 0;
"param_diag_MallocStackLogging_enableDuringAttach" = 0;
"param_diag_MallocStackLogging_enableForXPC" = 1;
"param_diag_allowLocationSimulation" = 1;
"param_diag_checker_tpc_enable" = 1;
"param_diag_gpu_frameCapture_enable" = 0;
"param_diag_gpu_shaderValidation_enable" = 0;
"param_diag_gpu_validation_enable" = 0;
"param_diag_memoryGraphOnResourceException" = 0;
"param_diag_queueDebugging_enable" = 1;
"param_diag_runtimeProfile_generate" = 0;
"param_diag_sanitizer_asan_enable" = 0;
"param_diag_sanitizer_tsan_enable" = 0;
"param_diag_sanitizer_tsan_stopOnIssue" = 0;
"param_diag_sanitizer_ubsan_stopOnIssue" = 0;
"param_diag_showNonLocalizedStrings" = 0;
"param_diag_viewDebugging_enabled" = 1;
"param_diag_viewDebugging_insertDylibOnLaunch" = 1;
"param_install_style" = 0;
"param_launcher_UID" = 2;
"param_launcher_allowDeviceSensorReplayData" = 0;
"param_launcher_kind" = 0;
"param_launcher_style" = 99;
"param_launcher_substyle" = 8192;
"param_runnable_appExtensionHostRunMode" = 0;
"param_runnable_productType" = "com.apple.product-type.application";
"param_structuredConsoleMode" = 1;
"param_testing_launchedForTesting" = 0;
"param_testing_suppressSimulatorApp" = 0;
"param_testing_usingCLI" = 0;
"sdk_canonicalName" = "iphoneos17.0";
"sdk_osVersion" = "17.0";
"sdk_variant" = iphoneos;
}
--System Information
macOS Version 13.5.2 (Build 22G91)
Xcode 15.0 (22265) (Build 15A240d)
Timestamp: 2023-09-14T15:57:40+08:00
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)Supporting other languages or locales. (aka i18n)a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemse: OS-version specificAffects only some versions of the relevant operating systemAffects only some versions of the relevant operating systemfound in release: 3.13Found to occur in 3.13Found to occur in 3.13found in release: 3.14Found to occur in 3.14Found to occur in 3.14has 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-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Activity
huycozy commentedon Sep 14, 2023
Hi @zhangyanzhu88
I checked this issue on iPhone 14 Pro, iOS 17.0 but can't see any crash. I'm using the same XCode Build 15A240d as yours.
Can you try with minimal sample code below? If the crash still occurs, please provide entire stack trace and output of
flutter run -v.And please provide the output of
flutter doctor -vas well. Thank you!Minimal sample code
zhangyanzhu88 commentedon Sep 15, 2023
flutter doctor -v
zhangyanzhu88 commentedon Sep 15, 2023
47_1694741786.mp4
zhangyanzhu88 commentedon Sep 15, 2023
zhangyanzhu88 commentedon Sep 15, 2023
flutter run -v
huycozy commentedon Sep 15, 2023
Thanks for the update. I re-formatted your comment for better readability.
Although it's unclear why I couldn't reproduce the issue previously, I can reproduce it now. Reproduced this issue on
iPhone 14 Pro, iOS 17whilst it works normally oniPhone 7, iOS 15.7.2.Even though I couldn't see any error from the output console, the app was frozen, and couldn't input further.
flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.13.4, on macOS 13.5 22G74 darwin-x64, locale en-VN) • Flutter version 3.13.4 on channel stable at /Users/huynq/Documents/GitHub/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 367f9ea16b (31 hours ago), 2023-09-12 23:27:53 -0500 • Engine revision 9064459a8b • Dart version 3.1.2 • DevTools version 2.25.0 [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0) • Android SDK at /Users/huynq/Library/Android/sdk • Platform android-34, build-tools 32.0.0 • ANDROID_HOME = /Users/huynq/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.0) • Xcode at /Applications/Xcode15RC.app/Contents/Developer • Build 15A240d • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2022.2) • 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 17.0.6+0-17.0.6b802.4-9586694) [✓] VS Code (version 1.82.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.72.0 [✓] Connected device (5 available) • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 11 (API 30) • iPhone (mobile) • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios • iOS 15.7.2 19H218 • iPhone 14 Pro (mobile) • 3BD60F46-FB95-41A0-A179-8AA3F637DA4E • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator) • macOS (desktop) • macos • darwin-x64 • macOS 13.5 22G74 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 117.0.5938.62 [✓] Network resources • All expected network resources are available. • No issues found!11 remaining items
stuartmorgan-g commentedon Sep 21, 2023
@hellohuanlin Assigning to you since you said you were looking into this; if you don't end up having time to work on this please let me know. This is a likely CP candidate (assuming a fix that's viable for CP).
castleche commentedon Sep 22, 2023
This could repro with iOS 17.0.1. As more users are upgrading to iOS 17, this issue is causing increasingly lost to our app. Hope this can be fixed by Apple or Flutter soon.
jkgatt commentedon Sep 25, 2023
Another issue similarly related to this too is when having Auto-Correction on.
Typing in both Japanese or Chinese and English characters seems to hang at some point and crashes the whole app.
Reproducible steps:
Reproduced this on three different devices, all on iOS 17.0.1.
The log that seems related to this issue:

hellohuanlin commentedon Oct 4, 2023
quick update that i found a potential fix, which happens to resolve another issue with text input. I am doing more testing in case of regression.
jkgatt commentedon Oct 5, 2023
@hellohuanlin this is great news, please keep us informed!
yx-mike commentedon Oct 22, 2023
[CP (beta)] [ios17][text_input]fix ios 17.0 keyboard freeze when swit…
zhangyanzhu88 commentedon Nov 21, 2023
@huycozy hi,Is the problem solved?
hellohuanlin commentedon Nov 21, 2023
@zhangyanzhu88 this is resolved. I think it's also released yesterday iirc.
zhangyanzhu88 commentedon Nov 22, 2023
@hellohuanlin thank you
github-actions commentedon Dec 6, 2023
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.