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
相关推荐
橙子家5 小时前
浏览器缓存之【基础键值存储】:Local storage 和 Session storage
前端
星星在线7 小时前
MusicFree:一个「All in One」的个人音乐服务器,让听歌回归简单
前端·后端
IT_陈寒8 小时前
Redis的SETNX并发问题让我加了三天班
前端·人工智能·后端
demo007x8 小时前
Docling 文档转换以及技术架构分析
前端·后端·程序员
京东云开发者9 小时前
京东市民服务又“上新”!这次是黑龙江“龙易办”
前端
袋鱼不重9 小时前
我的神奇同事,AI 用多了居然写了个 Open In Codex
前端·后端·ai编程
Fireworks10 小时前
深入vue3源码解读 -- 1、响应式的基础概念
前端
程序员黑豆10 小时前
JDK 下载安装与配置详细教程
java·前端·ai编程
hunterandroid10 小时前
文件存储:内部存储与外部存储
前端
NorBugs10 小时前
飞机大战 Low 版 (Made in AI)
前端