2020.12.21-12.28 人工智能行业每周技术动态

本周是2020年的最后一周,还有3天,2020年就将画上句号。
这一年的计划,大家都完成了吗?

因为疫情的原因,很多人都感觉时间太短,一晃就到了年末,又到了为新的一年做规划的时间了

大白也在反思,这一年,自己成长了哪些?
可能工作上做了很多的项目,训练了很多的模型。
但是对于自身, 究竟成长了哪些?未来一年,还要做哪些?

那么首先要明白,对于自身来说,成长的意义是什么?
周末两天,因为家里长辈过世,回老家了一趟,在开车来回的路上,大白想了很多。

大白觉得对于自身来说,成长主要涉及三点,供大家参考。

● 认清自己
● 给时间定价
● 快速成长

(1) 认清自己

每个人从事的岗位不同,公司不同,技术方向以及技术领域也都不同。
专业能力可以让我们在某一特定领域走的更深,而可迁移能力可以让我们的路走的更宽。

所以最好及时认清自己,如果专业能力做不到顶尖,那就让自己的综合能力做到顶尖。
做出正确的选择,这样也可以让我们未来的道路走得更宽。

(2)给时间定价

有的时候,总是感慨时间太快,从周一开始,一周很快就过去。
而除了工作之外,很多时间,都浪费在无效的事情上。
因此要学会将我们的时间定价,当然不是以现在的价值标价,而是用2年后期待的收入标价。

比如,期待年入100w,换算下来,一小时473元。
按照这个标准,如果一件事情的价值大于473元,就做,否则,就不做。
所以关注的不是当下的时间价值,而是2年后的。

成长是有复利的,如果每天都在做有价值,成长自然很快。
人生是一场马拉松,我们把眼光放远一些,把时间砸到能产生长期价值的事情上,不浪费时间,浪费生命。

在这里插入图片描述

(3)快速成长
我们回忆一下,过去一年最深刻的一件事是什么?
给我们成长带来帮助最大的时期,是什么时候?
肯定是人生发生转折的时候,从一个熟知的领域,到了一个完全陌生的领域中的时候。

因此多去接触全新的领域,认识一些从来不认识的人,把自己放到一个不确定的环境中。
不要害怕犯错,从错误中学习

这个时代,正在以我们肉眼可见的速度,向前推进。
选择安稳,其实并不是安稳,而是选择了落后。

历史以血淋淋的故事告诉我们,落后是一定要挨打的。
因此,跳出自己的认知领域,多去做一些快速成长的有价值的事情。

前不久,听过一个对于“三十而立”不同的解释。
三十而立,真的一下子就立起来了吗?事业上会有突飞猛进的变化吗?

其实并不是,而是说,三十岁以后,之前庇护我们,为我们遮风挡雨的一些人,都将慢慢远去,生活中的很多事,都要靠我们自己了。

所以正如乔布斯所说,你必须相信,你现在做的点点滴滴,会在你未来的生命里,以某种方式串联起来,带给你无穷的收获,让你变得与众不同。

各位朋友,一起加油!

之前的周报,大白会将每周的精华内容汇总起来,整理到《大白AI周报精华汇总》中,点击即可查看

后期需要哪方面的项目知识,可以直接去对应阅读

大白也在不断收集更新各个项目算法作者及从业经验的视频分享,希望能让大家提高一些探索的效率点击查看

整理汇总:江大白
内容周期:2020.12.21-2020.12.28
同步公众号:江大白


1 整理涉及公众号名单

(1)我爱计算机视觉
(2)Cver
(3)Datawhale
(4)量子位
(5)极市平台
(6)新智元
(7)机器之心
(8)AI算法与图像处理
(9)Opencv学堂
(10)PaperWeekly
(11)机器学习算法工程师
(12)AI研习社
(13)GiantPandaCV
(14)AI深度学习视线
(15)七月在线实验室
(16)人工智能前沿讲习
(17)AI科技评论
(18)机器学习算法与Python精研
(19)AIZOO
(20)微软研究员AI头条
(21)VALSE
(22)AI算法修炼营
(23)有三AI
(24)AlWalker
(25)AI公园
(26)AI人工智能初学者
(27)计算机视觉之路
(28)小白学视觉

2 行业精华文章汇总

2.1 基础知识方面

2.1.1 深度学习相关

(1)一文带你了解NeurlPS2020的模型剪枝研究
链接:https://mp.weixin.qq.com/s/wOaCjSifZqkndaGbst1-aw
(2)从频域角度重新思考注意力机制——FcaNet
链接:https://mp.weixin.qq.com/s/dvGO_GTLfKTpWyFWqkoMEQ

2.1.2 机器学习相关

(1)GBDT 算法如何用于分类问题
链接:https://mp.weixin.qq.com/s/xJGV-r1CpqB7vZSb1wX9lg

2.2 研究方向方面

2.2.1 目标检测

(1)开源项目|基于darknet实现量化感知训练,已实现yolov3-tiny所有算子
链接:https://mp.weixin.qq.com/s/HVXNKZEe6Yd7PMBuiBmWyA

2.2.2 图像分割

(1)一文快速回顾U-Net Family
链接:https://mp.weixin.qq.com/s/G-IWKOGs-Uk6ecpvMZJclA
(2)直播回放丨田值:BoxInst,实例分割创新式突破!仅用Box标注,实现COCO 33.2AP!
链接:https://mp.weixin.qq.com/s/tbLJO_Cf4ZHQdSOYnUbCCw

2.2.3 关键点定位

(1)谷歌发布 MediaPipe Holistic,实现移动端同时进行人脸、手部和人体关键点检测跟踪
链接:https://mp.weixin.qq.com/s/Zspye6vESfqbeNeJv2sx1g

2.3 项目应用方面

2.3.1 医疗预测

(1)2020 数字人体视觉挑战赛宫颈癌风险智能诊断_算法赛道亚军VNNI赛道冠军_LLLLC团队攻略分享
链接:https://mp.weixin.qq.com/s/p7vbbaYP3ZrfJtOKq0jTwA

3 行业&拓展阅读动态汇总

3.1 行业动态

(1)遥感图像+CNN,预测区域人口收入水平
链接:https://mp.weixin.qq.com/s/B9Vf6DXavDX8iaC11ZY-TA
(2)模型花费几十万美元,五年之间指导无数项目,才发现负样本用的是null?
链接:https://mp.weixin.qq.com/s/l3Vrjbj0ICYsbXQ-c2CDqQ

3.2 拓展阅读

(1)吴恩达圣诞寄语:回顾2020年,这些AI大事件让我无法忘怀…
链接:https://mp.weixin.qq.com/s/FmVCOwAZ4fIYQsdn7dsRhg
(2)清华贵系的期末大作业:奋战三周,造台计算机!
链接:https://mp.weixin.qq.com/s/TCEuOillFb22PSfMQpqwmA

4 Pytorch基础教程

(1)PyTorch 多机多卡训练:DDP 实战与技巧
链接:https://mp.weixin.qq.com/s/2E455tFiCqq2BVdt0BfkIA

在这里插入图片描述

Flutter 项目中升级 google_mlkit_text_recognition 从0.11.0到 0.15.0,原来页面正常输入信息的输入框,现在只能删除,不能输入,可以调出输入法,就是无法输入信息,也没有任何错误日志出现,可能的原因是什么PS D:\zhuangyunweishi> flutter run -d emulator-5554 Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source! Launching lib\main.dart on sdk gphone64 x86 64 in debug mode... Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source! SourceNodeId()J (unsupported,test-api, reflection, allowed) W/ample.loadguard( 4563): Accessing hidden method Landroid/view/accessibility/AccessibilityRecord;->getSourceNodeId()J (unsupported, reflection, allowed) W/ample.loadguard( 4563): Accessing hidden field Landroid/view/accessibility/AccessibilityNodeInfo;->mChiW/ample.loadguard( 4563): Accessing hidden method Landroid/util/LongArray;->get(I)J (unsupported, reflection, allowed) W/HWUI ( 4563): Unknown dataspace 0 Syncing files to device sdk gphone64 x86 64... 349ms Flutter run key commands. r Hot reload. R Hot restart. h List all available interactive commands. d Detach (terminate "flutter run" but leave application running). c Clear the screen q Quit (terminate the application on the device). A Dart VM Service on sdk gphone64 x86 64 is available at: http://127.0.0.1:59853/CVGpwsWg3j8=/ The Flutter DevTools debugger and profiler on sdk gphone64 x86 64 is available at: http://127.0.0.1:9102?uri=http://127.0.0.1:59853/CVGpwsWg3j8=/ I/Choreographer( 4563): Skipped 61 frames! The application may be doing too much work on its main thread. I/WindowExtensionsImpl( 4563): Initializing Window Extensions, vendor API level=6, activity embedding enabled=true W/HWUI ( 4563): Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... W/HWUI ( 4563): Failed to initialize 101010-2 format, error = EGL_SUCCESS I/Gralloc4( 4563): mapper 4.x is not supported I/ample.loadguard( 4563): Compiler allocated 5174KB to compile void android.view.ViewRootImpl.performTraversals() I/ample.loadguard( 4563): Compiler allocated 5417KB to compile void android.view.ViewRootImpl.performTraversals() I/Choreographer( 4563): Skipped 96 frames! The application may be doing too much work on its main thread. D/ProfileInstaller( 4563): Installing profile for com.example.loadguard I/Choreographer( 4563): Skipped 58 frames! The application may be doing too much work on its main thread. D/EGL_emulation( 4563): app_time_stats: avg=72.81ms min=12.28ms max=215.51ms count=13 W/WindowOnBackDispatcher( 4563): sendCancelIfRunning: isInProgress=false callback=io.flutter.embedding.android.FlutterActivity$1@a62fe0a D/EGL_emulation( 4563): app_time_stats: avg=39.17ms min=3.82ms max=387.11ms count=26 D/EGL_emulation( 4563): app_time_stats: avg=100.25ms min=29.67ms max=506.91ms count=10 D/EGL_emulation( 4563): app_time_stats: avg=25.05ms min=7.17ms max=82.55ms count=33 D/EGL_emulation( 4563): app_time_stats: avg=53.35ms min=18.07ms max=178.05ms count=19 W/WindowOnBackDispatcher( 4563): sendCancelIfRunning: isInProgress=false callback=io.flutter.embedding.android.FlutterActivity$1@a62fe0a D/EGL_emulation( 4563): app_time_stats: avg=171.16ms min=11.99ms max=1100.23ms count=11 I/flutter ( 4563): [LOG] _loadPresetData called, template: 平板车 I/flutter ( 4563): [LOG] after _loadPresetData: productCode=LLD-7042, batchNumber=250615F10422, quantity=20 I/flutter ( 4563): [LOG] build: productCode=LLD-7042, batchNumber=250615F10422, quantity=20 D/EGL_emulation( 4563): app_time_stats: avg=104.12ms min=6.13ms max=1251.53ms count=14 W/WindowOnBackDispatcher( 4563): sendCancelIfRunning: isInProgress=false callback=io.flutter.embedding.android.FlutterActivity$1@a62fe0a I/flutter ( 4563): [LOG] _batchNumberController: "250615F10422" I/flutter ( 4563): [LOG] _batchFocusNode.hasFocus: "true" I/flutter ( 4563): [LOG] _batchFocusNode 获得焦点,重置输入法连接 I/flutter ( 4563): [LOG] _batchNumberController: "250615F10422" D/EGL_emulation( 4563): app_time_stats: avg=87.36ms min=5.70ms max=980.71ms count=16 I/ImeTracker( 4563): com.example.loadguard:a4714024: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser false D/InputMethodManager( 4563): showSoftInput() view=io.flutter.embedding.android.FlutterView{343be5b VFE...... .F....ID 0,0-1344,2992 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT D/InputConnectionAdaptor( 4563): The input method toggled cursor monitoring on D/InsetsController( 4563): show(ime(), fromIme=true) W/InteractionJankMonitor( 4563): Initializing without READ_DEVICE_CONFIG permission. enabled=false, interval=1, missedFrameThreshold=3, frameTimeThreshold=64, package=com.example.loadguard D/EGL_emulation( 4563): app_time_stats: avg=122.23ms min=9.35ms max=322.95ms count=8 I/ImeTracker( 4563): com.example.loadguard:a4714024: onShown D/EGL_emulation( 4563): app_time_stats: avg=1130.69ms min=2.70ms max=10409.28ms count=10 I/flutter ( 4563): [LOG] _batchNumberController: "250615F1042" I/flutter ( 4563): [LOG] onChanged batchNumber: 250615F1042 I/flutter ( 4563): [LOG] _batchNumberController: "250615F104" I/flutter ( 4563): [LOG] onChanged batchNumber: 250615F104 I/flutter ( 4563): [LOG] _batchNumberController: "250615F10" I/flutter ( 4563): [LOG] onChanged batchNumber: 250615F10 I/flutter ( 4563): [LOG] _batchNumberController: "250615F1" I/flutter ( 4563): [LOG] onChanged batchNumber: 250615F1 D/EGL_emulation( 4563): app_time_stats: avg=89.75ms min=11.73ms max=260.84ms count=11 I/flutter ( 4563): [LOG] _batchNumberController: "250615F" I/flutter ( 4563): [LOG] onChanged batchNumber: 250615F I/flutter ( 4563): [LOG] _batchNumberController: "250615" I/flutter ( 4563): [LOG] onChanged batchNumber: 250615 I/flutter ( 4563): [LOG] _batchNumberController: "25061" I/flutter ( 4563): [LOG] onChanged batchNumber: 25061 I/flutter ( 4563): [LOG] _batchNumberController: "2506" I/flutter ( 4563): [LOG] onChanged batchNumber: 2506 D/EGL_emulation( 4563): app_time_stats: avg=286.45ms min=234.33ms max=332.40ms count=4 I/flutter ( 4563): [LOG] _batchNumberController: "250" I/flutter ( 4563): [LOG] onChanged batchNumber: 250 D/EGL_emulation( 4563): app_time_stats: avg=480.30ms min=474.05ms max=492.52ms count=3 D/EGL_emulation( 4563): app_time_stats: avg=500.04ms min=500.03ms max=500.05ms count=2 D/EGL_emulation( 4563): app_time_stats: avg=500.02ms min=499.29ms max=501.43ms count=3 D/EGL_emulation( 4563): app_time_stats: avg=499.61ms min=499.27ms max=500.01ms count=3 D/EGL_emulation( 4563): app_time_stats: avg=509.42ms min=500.94ms max=517.91ms count=2 I/flutter ( 4563): [LOG] _quantityController: "20" I/flutter ( 4563): [LOG] _batchFocusNode.hasFocus: "false" I/flutter ( 4563): [LOG] _quantityFocusNode.hasFocus: "true" I/flutter ( 4563): [LOG] _quantityFocusNode 获得焦点,重置输入法连接 I/flutter ( 4563): [LOG] _quantityController: "20" I/ImeTracker( 4563): com.example.loadguard:3fa548c6: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser false D/InputMethodManager( 4563): showSoftInput() view=io.flutter.embedding.android.FlutterView{343be5b VFE...... .F...... 0,0-1344,2992 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT D/InputConnectionAdaptor( 4563): The input method toggled cursor monitoring on D/InputConnectionAdaptor( 4563): The input method toggled cursor monitoring off D/InputConnectionAdaptor( 4563): The input method toggled cursor monitoring on D/InsetsController( 4563): show(ime(), fromIme=true) I/ImeTracker( 4563): com.example.loadguard:3fa548c6: onCancelled at PHASE_CLIENT_APPLY_ANIMATION D/EGL_emulation( 4563): app_time_stats: avg=132.37ms min=24.18ms max=498.39ms count=10 I/flutter ( 4563): [LOG] _quantityController: "2" I/flutter ( 4563): [LOG] onChanged quantity: 2 I/flutter ( 4563): [LOG] setState in onChanged quantity, value: 2 I/flutter ( 4563): [LOG] build: productCode=LLD-7042, batchNumber=250, quantity=2 D/EGL_emulation( 4563): app_time_stats: avg=118.76ms min=5.83ms max=501.22ms count=11 D/EGL_emulation( 4563): app_time_stats: avg=499.52ms min=499.51ms max=499.54ms count=3 D/EGL_emulation( 4563): app_time_stats: avg=499.96ms min=499.33ms max=500.58ms count=2 D/EGL_emulation( 4563): app_time_stats: avg=500.42ms min=498.21ms max=501.73ms count=3 I/flutter ( 4563): [LOG] _quantityFocusNode.hasFocus: "false" I/ImeTracker( 4563): com.example.loadguard:bb1c0f0b: onRequestHide at ORIGIN_CLIENT reason HIDE_SOFT_INPUT fromUser false D/InsetsController( 4563): hide(ime(), fromIme=true) D/InputConnectionAdaptor( 4563): The input method toggled cursor monitoring off D/EGL_emulation( 4563): app_time_stats: avg=8097.52ms min=16.38ms max=16178.67ms count=2 D/EGL_emulation( 4563): app_time_stats: avg=210.48ms min=22.28ms max=383.62ms count=5 I/ImeTracker( 4563): com.example.loadguard:3160c9a6: onRequestHide at ORIGIN_CLIENT reason HIDE_SOFT_INPUT_ON_ANIMATION_STATE_CHANGED fromUser false I/ImeTracker( 4563): com.example.loadguard:bb1c0f0b: onHidden D/EGL_emulation( 4563): app_time_stats: avg=199.13ms min=29.11ms max=877.45ms count=6 I/flutter ( 4563): [LOG] build: productCode=LLD-7042, batchNumber=250715F10422, quantity=20 W/WindowOnBackDispatcher( 4563): sendCancelIfRunning: isInProgress=false callback=io.flutter.embedding.android.FlutterActivity$1@a62fe0a D/EGL_emulation( 4563): app_time_stats: avg=71.67ms min=6.31ms max=892.22ms count=16 I/flutter ( 4563): [LOG] _batchNumberController: 250715F10422 I/ImeTracker( 4563): com.example.loadguard:64b38682: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser false D/InputMethodManager( 4563): showSoftInput() view=io.flutter.embedding.android.FlutterView{343be5b VFE...... .F...... 0,0-1344,2992 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT D/EGL_emulation( 4563): app_time_stats: avg=23.28ms min=2.54ms max=224.42ms count=29 D/InputConnectionAdaptor( 4563): The input method toggled cursor monitoring on D/InsetsController( 4563): show(ime(), fromIme=true) D/EGL_emulation( 4563): app_time_stats: avg=776.08ms min=10.58ms max=3659.82ms count=5 I/ImeTracker( 4563): com.example.loadguard:64b38682: onShown I/flutter ( 4563): [LOG] _batchNumberController: 250715F1042 I/flutter ( 4563): [LOG] onChanged batchNumber: 250715F1042 D/EGL_emulation( 4563): app_time_stats: avg=120.61ms min=16.27ms max=495.79ms count=11 I/flutter ( 4563): [LOG] _batchNumberController: 250715F104 I/flutter ( 4563): [LOG] onChanged batchNumber: 250715F104 I/flutter ( 4563): [LOG] _batchNumberController: 250715F10 I/flutter ( 4563): [LOG] onChanged batchNumber: 250715F10 I/flutter ( 4563): [LOG] _batchNumberController: 250715F1 I/flutter ( 4563): [LOG] onChanged batchNumber: 250715F1 I/flutter ( 4563): [LOG] _batchNumberController: 250715F I/flutter ( 4563): [LOG] onChanged batchNumber: 250715F I/flutter ( 4563): [LOG] _batchNumberController: 250715 I/flutter ( 4563): [LOG] onChanged batchNumber: 250715 I/flutter ( 4563): [LOG] _batchNumberController: 25071 I/flutter ( 4563): [LOG] onChanged batchNumber: 25071 D/EGL_emulation( 4563): app_time_stats: avg=108.70ms min=13.49ms max=248.17ms count=10 I/flutter ( 4563): [LOG] _batchNumberController: 2507 I/flutter ( 4563): [LOG] onChanged batchNumber: 2507 I/flutter ( 4563): [LOG] _batchNumberController: 250 I/flutter ( 4563): [LOG] onChanged batchNumber: 250 D/EGL_emulation( 4563): app_time_stats: avg=358.31ms min=157.83ms max=537.44ms count=4 D/EGL_emulation( 4563): app_time_stats: avg=489.67ms min=460.90ms max=506.42ms count=3 D/EGL_emulation( 4563): app_time_stats: avg=499.17ms min=496.25ms max=502.55ms count=3 D/EGL_emulation( 4563): app_time_stats: avg=498.30ms min=495.33ms max=500.43ms count=3 D/EGL_emulation( 4563): app_time_stats: avg=499.64ms min=497.64ms max=501.15ms count=3 D/EGL_emulation( 4563): app_time_stats: avg=501.02ms min=499.58ms max=502.46ms count=2 D/EGL_emulation( 4563): app_time_stats: avg=499.58ms min=498.45ms max=500.49ms count=3这段日志,在输入框中删除正常,无法输入信息,输入法可以调出,你能看出来问题在哪里吗?
最新发布
07-16
<think>我们注意到在升级了google_mlkit_text_recognition插件后出现了输入框无法输入的问题。从日志中可以看到,输入法可以调出,但是无法输入新的字符,只能删除。这通常表明输入事件被拦截或处理过程中出现了问题。 可能的原因分析: 1. **插件冲突**:升级后的google_mlkit_text_recognition插件可能引入了某些全局的输入事件监听,拦截了输入事件。特别是如果该插件使用了原生的输入事件处理(例如用于文本识别),可能会干扰Flutter的文本输入。 2. **焦点问题**:虽然日志中显示焦点切换正常(`_batchFocusNode`和`_quantityFocusNode`都能获得焦点),但可能插件在后台占用了焦点,或者输入事件被错误地路由到了其他组件。 3. **输入法连接问题**:日志中有“重置输入法连接”的日志,但并没有报告错误。然而,在输入法显示后,输入事件没有被传递到Flutter的TextInput连接。 4. **Flutter引擎的文本输入通道问题**:可能是Flutter引擎的文本输入通道(TextInputChannel)被插件干扰,导致输入事件无法正确传递。 排查建议: 1. **检查是否在页面中使用了google_mlkit_text_recognition**:如果该页面并没有直接使用该插件,那么可能是插件升级后全局初始化了一些东西。尝试在应用中移除该插件的使用(包括初始化)看是否解决问题。 2. **检查插件版本兼容性**:查看插件的更新日志,特别是0.11.0到0.15.0之间的变更,是否有破坏性改动。已知该插件在0.12.0版本进行了空安全迁移,可能引入了其他改动。 3. **检查输入事件监听**:在Flutter中,如果有其他地方监听了全局的手势(如使用Listener或GestureDetector覆盖了整个屏幕),可能会拦截输入事件。但这个问题在升级插件后才出现,所以更可能是插件引起。 4. **尝试在另一个页面使用输入框**:创建一个新的测试页面,只包含一个简单的TextField,检查是否可以输入。如果简单页面可以,则问题可能出在特定页面的逻辑;如果也不可以,则可能是插件全局影响。 5. **检查Flutter版本**:确保Flutter版本与插件兼容。可以尝试升级Flutter到最新稳定版。 6. **查看插件issue**:在插件的Github仓库中查看是否有类似问题的issue。 根据日志,我们看到在输入框获得焦点时,有重置输入法连接的日志,但随后输入时,只有删除操作触发了onChanged,而没有输入字符的触发。这暗示着输入事件可能被插件或与其相关的原生代码拦截了。 由于问题是在升级插件后出现的,最可能的原因是插件本身的问题。建议先回退到0.11.0版本确认问题是否消失,以确定是插件升级导致。 如果确认是插件问题,可以尝试以下措施: - 等待插件更新。 - 在插件仓库中提交issue。 - 检查插件的原生代码部分,特别是与输入事件相关的部分(如Android的InputConnection、InputMethodManager等)。 另外,从日志中看到有很多帧被跳过(Skipped frames),说明主线程负担较重,但这不是导致无法输入的直接原因。 §§相关问题§§ 1. 在Flutter项目中,如何检测输入事件是否被其他组件或插件拦截? 2. 如何调试Flutter中TextField无法输入的问题? 3. google_mlkit_text_recognition插件在0.15.0版本中可能引入了哪些导致输入框无法输入的改动? 4. 在Flutter应用中,如何排查插件之间的兼容性问题? 5. 当Flutter应用出现输入框只能删除不能输入时,除了插件冲突,还有哪些可能的原因?</think>### 问题分析 根据日志和现象,输入框只能删除无法输入的原因可能是: 1. **焦点冲突** - 日志显示 `_batchFocusNode.hasFocus` 和 `_quantityFocusNode.hasFocus` 频繁切换(`I/flutter ( 4563): [LOG] _batchFocusNode.hasFocus: "true"`) - 可能插件升级后引入了额外的焦点监听,干扰了 Flutter 的默认焦点管理 2. **输入法连接异常** - 日志多次出现 `重置输入法连接` 的提示(`I/flutter ( 4563): [LOG] _batchFocusNode 获得焦点,重置输入法连接`) - 输入法调出后无法输入,说明 `InputConnection` 可能被插件错误重置或拦截 3. **手势冲突** - `google_mlkit_text_recognition` 的文本识别功能可能新增了全局手势监听(如截屏识别),覆盖了输入框的触摸事件 4. **插件兼容性问题** - 从 0.11.0 → 0.15.0 存在破坏性变更: ```yaml dependencies: google_mlkit_text_recognition: ^0.15.0 ``` - 新版可能修改了原生层的 `TextInput` 交互逻辑(尤其 Android 的 `InputMethodManager`) 5. **线程阻塞** - 日志频繁出现 `Skipped XX frames`(`I/Choreographer( 4563): Skipped 96 frames!`) - 插件可能在新版本中引入了主线程阻塞操作,导致输入事件延迟处理 --- ### 解决方案 1. **降级验证** 临时回退版本验证问题: ```yaml dependencies: google_mlkit_text_recognition: 0.11.0 # 确认是否版本问题 ``` 2. **焦点隔离** 在输入框外层包裹 `FocusScope` 限制焦点传播: ```dart FocusScope( child: TextField( focusNode: _myFocusNode, ), ); ``` 3. **检查手势冲突** 禁用插件的主动文本识别功能测试: ```dart // 在输入页面暂停插件 void initState() { super.initState(); TextRecognizer(textRecognizerOptions).close(); // 暂停识别器 } ``` 4. **查看插件变更** 检查 [0.15.0 更新日志](https://pub.dev/packages/google_mlkit_text_recognition/changelog),重点关注- `TextInput` 相关改动 - Android 的 `InputConnection` 处理 - 新增的生命周期监听 5. **启用 Flutter 调试工具** 在 `main.dart` 中添加输入事件监听: ```dart void main() { WidgetsFlutterBinding.ensureInitialized(); ServicesBinding.instance.keyboard.addHandler(_keyboardHandler); runApp(MyApp()); } bool _keyboardHandler(KeyEvent event) { debugPrint('KEY EVENT: ${event.character}'); // 检查输入事件是否被捕获 return true; } ``` ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值