flutter使用html_editor_enhanced: ^2.6.0后,编辑框无法获取焦点,无法操作

flutter使用html_editor_enhanced: ^2.6.0后,编辑框无法获取焦点,无法操作,报如下错误:

dart 复制代码
PlatformException(error, Unknown feature SUPPRESS_ERROR_PAGE, null, java.lang.RuntimeException: Unknown feature SUPPRESS_ERROR_PAGE
I/flutter (26600): 	at androidx.webkit.internal.WebViewFeatureInternal.isSupported(WebViewFeatureInternal.java:649)
I/flutter (26600): 	at androidx.webkit.internal.WebViewFeatureInternal.isSupported(WebViewFeatureInternal.java:618)
I/flutter (26600): 	at androidx.webkit.WebViewFeature.isFeatureSupported(WebViewFeature.java:611)
I/flutter (26600): 	at com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview.InAppWebView.prepare(InAppWebView.java:436)
I/flutter (26600): 	at com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview.FlutterWebView.<init>(FlutterWebView.java:82)
I/flutter (26600): 	at com.pichillilorenzo.flutter_inappwebview_android.webview.FlutterWebViewFactory.create(FlutterWebViewFactory.java:67)
I/flutter (26600): 	at io.flutter.plugin.platform.PlatformViewsController.createPlatformView(PlatformViewsController.java:527)
I/flutter (26600): 	at io.flutter.plugin.platform.PlatformViewsController$1.createForPlatformViewLayer(PlatformViewsCo
dart 复制代码
Exception: HTML editor is still loading, please wait before evaluating this JS: $('#summernote-2').summernote('code', '');!
I/flutter (31854): [2025-05-27 17:54:49.996853 | Catcher 2 | INFO] 
I/flutter (31854): [2025-05-27 17:54:49.997095 | Catcher 2 | INFO] ------- STACK TRACE -------
I/flutter (31854): [2025-05-27 17:54:49.997442 | Catcher 2 | INFO] #0      HtmlEditorController._evaluateJavascript (package:html_editor_enhanced/src/html_editor_controller_mobile.dart:261:9)
I/flutter (31854): [2025-05-27 17:54:49.997599 | Catcher 2 | INFO] #1      HtmlEditorController.setText (package:html_editor_enhanced/src/html_editor_controller_mobile.dart:85:5)

错误原因:

html_editor_enhanced中使用的flutter_inappwebview 插件内部调用了 AndroidX WebView 的 SUPPRESS_ERROR_PAGE 特性检测,但你的设备/系统版本的 WebView 不支持这个新特性,导致异常抛出

解决办法:

降低webview_flutter插件的版本

使用如下版本:

dart 复制代码
webview_flutter: ^3.0.0
相关推荐
雪隐7 分钟前
个人电脑玩AI-13让5060 Ti给你打工——我用 0.9B 小模型终结了"谁来记会议纪要"这个世纪难题
前端·人工智能·后端
橘子星10 分钟前
我一个前端切图仔,凭什么能在浏览器里跑大模型?
前端·javascript·前端框架
70asunflower15 分钟前
初学者理解 Web 工作原理(完全教程)
前端
爱勇宝19 分钟前
《道德经》第 7 章:真正厉害的领导者,不抢主角
前端·后端·程序员
观远数据19 分钟前
Excel到数据资产池:文件数据入湖的治理规范怎么建
前端·javascript·excel
CoderWeen21 分钟前
我写了个能一步步点着看的 Dijkstra 可视化项目(Vue3 + Leaflet + Generator)
前端·javascript·vue.js
两点王爷42 分钟前
一个快速加载面和多面数据的html测试页面(可以导出geojson数据文件)
前端·html·gis
热爱前端的小张43 分钟前
第四章 接口和类型兼容性
前端
hunterandroid1 小时前
[鸿蒙从零到一] HarmonyOS 资源管理与多语言适配实战
前端
用户69371750013841 小时前
Claude Code终端日志Token占用实测:一个过滤器砍掉60%-90%
android·前端·后端