Flutter webview_flutter 包的握手失败

huangapple go评论100阅读模式
英文:

Flutter webview_flutter package handshake failed

问题

尝试使用webview_flutter包加载HTML文件时,会在加载时花费时间,并在打印此错误后加载WebView:

E/chromium(27944): [ERROR:ssl_client_socket_impl.cc(980)] handshake failed; returned -1, SSL error code 1, net_error -101

什么可能会触发这样的错误?

Flutter和WebView的版本:

Flutter(通道稳定,3.7.11)

webview_flutter:^4.0.2
英文:

When trying to load html file using webview_flutter package it takes time until loading while printing this error then it loads the webview

E/chromium(27944): [ERROR:ssl_client_socket_impl.cc(980)] handshake failed; returned -1, SSL error code 1, net_error -101

What could trigger such an error?

Flutter and Webview versions:

Flutter (Channel stable, 3.7.11)

webview_flutter: ^4.0.2

答案1

得分: 0

通过调试类似以下方式的 webview 错误来找到错误的来源:(仅适用于 Android)

onWebResourceError: (WebResourceError error) {
            log("RESOURCE ERROR DESCRIPTION ${error.description}");
            log("RESOURCE ERROR CODE ${error.errorCode}");
            log("RESOURCE ERROR Error Type ${error.errorType}");
            log("RESOURCE ERROR Failing URL ${error.url}");
          },

我可以发现错误的源头是网站本身的一些 UI 资源,比如 Popper 导致了这个错误。

英文:

By debugging the webview errors like this: (Only works on Android)

onWebResourceError: (WebResourceError error) {
            log("RESOURCE ERROR DESCRIPTION ${error.description}");
            log("RESOURCE ERROR CODE ${error.errorCode}");
            log("RESOURCE ERROR Error Type ${error.errorType}");
            log("RESOURCE ERROR Failing URL ${error.url}");
          },

I could find that the source of the errors is some UI resources in the website itself like Popper causes this error

huangapple
  • 本文由 发表于 2023年7月27日 20:24:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76779717.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定